File tree 1 file changed +5
-10
lines changed
1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"os"
6
6
"path"
7
- "path/filepath"
8
7
"runtime/debug"
9
8
"strings"
10
9
@@ -54,15 +53,11 @@ func defaults(flag string) string {
54
53
55
54
cwd , wdErr := os .Getwd ()
56
55
gitRoot , grErr := git .Root ()
57
- if wdErr == nil && grErr == nil {
58
- cwd = filepath .Clean (cwd )
59
- gitRoot = filepath .Clean (gitRoot )
60
- if cwd != gitRoot {
61
- prefix := strings .TrimPrefix (cwd , gitRoot )
62
- prefix = strings .TrimPrefix (prefix , string (os .PathSeparator ))
63
- prefix = strings .TrimSuffix (prefix , string (os .PathSeparator ))
64
- return path .Join (prefix , pat )
65
- }
56
+ if wdErr == nil && grErr == nil && cwd != gitRoot {
57
+ prefix := strings .TrimPrefix (cwd , gitRoot )
58
+ prefix = strings .TrimPrefix (prefix , string (os .PathSeparator ))
59
+ prefix = strings .TrimSuffix (prefix , string (os .PathSeparator ))
60
+ return path .Join (prefix , pat )
66
61
}
67
62
68
63
return def
You can’t perform that action at this time.
0 commit comments