use filepath.Abs to FindLeafInTree

This commit is contained in:
Denis Bilenko 2024-12-06 12:27:17 +01:00
parent d99bf3ac74
commit 2e102b7c1a
1 changed files with 4 additions and 1 deletions

View File

@ -136,7 +136,10 @@ func fetchRepositoryInfoDotGit(ctx context.Context, path string) (RepositoryInfo
} }
func FindLeafInTree(p string, leafName string) (string, error) { 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++ { for i := 0; i < 10000; i++ {
_, err = os.Stat(filepath.Join(p, leafName)) _, err = os.Stat(filepath.Join(p, leafName))