Skip to content

Commit 67aa03c

Browse files
committed
Fix possible bug
1 parent 99716af commit 67aa03c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/git/repo_base_gogit.go

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"errors"
1414
"os"
1515
"path/filepath"
16+
"strings"
1617

1718
gitealog "code.gitea.io/gitea/modules/log"
1819
"code.gitea.io/gitea/modules/setting"
@@ -77,6 +78,9 @@ func OpenRepository(ctx context.Context, repoPath string) (*Repository, error) {
7778
for scanner.Scan() {
7879
// FIXME: we just use the first alternate because it seems go-git don't support multiple alternates yet
7980
altPath := scanner.Text()
81+
if strings.HasSuffix(altPath, "objects") {
82+
altPath = filepath.Dir(altPath)
83+
}
8084
options.AlternatesFS = osfs.New(altPath)
8185
break
8286
}

0 commit comments

Comments
 (0)