Skip to content

Commit c197c74

Browse files
committed
use filepath.Abs to FindLeafInTree
1 parent ffec127 commit c197c74

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libs/git/info.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ func fetchRepositoryInfoDotGit(ctx context.Context, path string) (RepositoryInfo
136136
}
137137

138138
func FindLeafInTree(p string, leafName string) (string, error) {
139-
var err error
139+
p, err := filepath.Abs(p)
140+
if err != nil {
141+
return "", err
142+
}
140143
for i := 0; i < 10000; i++ {
141144
_, err = os.Stat(filepath.Join(p, leafName))
142145

0 commit comments

Comments
 (0)