Skip to content

Commit 8bd5fa1

Browse files
committed
fix test
1 parent 67fe734 commit 8bd5fa1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/repository/branch.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package repository
66
import (
77
"context"
88
"fmt"
9+
"strings"
910

1011
"code.gitea.io/gitea/models/db"
1112
git_model "code.gitea.io/gitea/models/git"
@@ -51,6 +52,9 @@ func SyncRepoBranchesWithRepo(ctx context.Context, repo *repo_model.Repository,
5152
{
5253
branches, _, err := gitRepo.GetBranchNames(0, 0)
5354
if err != nil {
55+
if strings.Contains(err.Error(), "ref file is empty") {
56+
return 0, nil
57+
}
5458
return 0, err
5559
}
5660
log.Trace("SyncRepoBranches[%s]: branches[%d]: %v", repo.FullName(), len(branches), branches)

0 commit comments

Comments
 (0)