File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 44 "fmt"
55 "os"
66 "path"
7- "path/filepath"
87 "runtime/debug"
98 "strings"
109
@@ -54,15 +53,11 @@ func defaults(flag string) string {
5453
5554 cwd , wdErr := os .Getwd ()
5655 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 )
6661 }
6762
6863 return def
You can’t perform that action at this time.
0 commit comments