Skip to content

Commit

Permalink
Fix adopt repository has empty object name in database (#31333) (#31335)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
GiteaBot and lunny authored Jun 12, 2024
1 parent 4b6ef92 commit 568ff10
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modules/repository/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func SyncRepoBranchesWithRepo(ctx context.Context, repo *repo_model.Repository,
if err != nil {
return 0, fmt.Errorf("UpdateRepository: %w", err)
}
repo.ObjectFormatName = objFmt.Name() // keep consistent with db

allBranches := container.Set[string]{}
{
Expand Down

0 comments on commit 568ff10

Please # to comment.