Skip to content

Commit 568ff10

Browse files
GiteaBotlunny
andauthored
Fix adopt repository has empty object name in database (#31333) (#31335)
Backport #31333 by @lunny Fix #31330 Fix #31311 A workaround to fix the old database is to update object_format_name to `sha1` if it's empty or null. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 parent 4b6ef92 commit 568ff10

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

modules/repository/branch.go

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func SyncRepoBranchesWithRepo(ctx context.Context, repo *repo_model.Repository,
4545
if err != nil {
4646
return 0, fmt.Errorf("UpdateRepository: %w", err)
4747
}
48+
repo.ObjectFormatName = objFmt.Name() // keep consistent with db
4849

4950
allBranches := container.Set[string]{}
5051
{

0 commit comments

Comments
 (0)