From 2e102b7c1a5d0c0ebfc3335a0982b07dd2c26488 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Fri, 6 Dec 2024 12:27:17 +0100 Subject: [PATCH] use filepath.Abs to FindLeafInTree --- libs/git/info.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/git/info.go b/libs/git/info.go index 01779da774..8523df24a2 100644 --- a/libs/git/info.go +++ b/libs/git/info.go @@ -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))