Skip to content

Commit

Permalink
use filepath.Abs to FindLeafInTree
Browse files Browse the repository at this point in the history
  • Loading branch information
denik committed Dec 9, 2024
1 parent d99bf3a commit 2e102b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libs/git/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ func fetchRepositoryInfoDotGit(ctx context.Context, path string) (RepositoryInfo
}

func FindLeafInTree(p string, leafName string) (string, error) {
var err error
p, err := filepath.Abs(p)
if err != nil {
return "", err
}
for i := 0; i < 10000; i++ {
_, err = os.Stat(filepath.Join(p, leafName))

Expand Down

0 comments on commit 2e102b7

Please sign in to comment.