File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ type config struct {
13
13
compare []string
14
14
benchCmd string
15
15
benchArgs []string
16
+ gitPath string
16
17
}
17
18
18
19
func newConfig (c * cli.Context ) config {
@@ -23,5 +24,6 @@ func newConfig(c *cli.Context) config {
23
24
compare : strings .Split (c .String ("compare" ), "," ),
24
25
benchCmd : c .String ("bench-cmd" ),
25
26
benchArgs : strings .Fields (c .String ("bench-args" )),
27
+ gitPath : c .String ("git-path" ),
26
28
}
27
29
}
Original file line number Diff line number Diff line change @@ -66,6 +66,11 @@ func main() {
66
66
Usage : "Specify arguments passed to -cmd" ,
67
67
Value : "test -run '^$' -bench . -benchmem ./..." ,
68
68
},
69
+ & cli.StringFlag {
70
+ Name : "git-path" ,
71
+ Usage : "Specify the path of the git repo" ,
72
+ Value : "." ,
73
+ },
69
74
},
70
75
}
71
76
@@ -76,7 +81,7 @@ func main() {
76
81
}
77
82
78
83
func run (c config ) error {
79
- r , err := git .PlainOpen ("." )
84
+ r , err := git .PlainOpen (c . gitPath )
80
85
if err != nil {
81
86
return xerrors .Errorf ("unable to open the git repository: %w" , err )
82
87
}
You can’t perform that action at this time.
0 commit comments