1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 23:17:19 +00:00

Use repo object format name instead of detecting from git repository (#29702)

It's unnecessary to detect the repository object format from git
repository. Just use the repository's object format name.
This commit is contained in:
Lunny Xiao
2024-03-11 05:30:36 +08:00
committed by GitHub
parent 851bd18234
commit 3c6fc25a77
6 changed files with 9 additions and 29 deletions

View File

@@ -148,12 +148,7 @@ func RestoreBranchPost(ctx *context.Context) {
return
}
objectFormat, err := git.GetObjectFormatOfRepo(ctx, ctx.Repo.Repository.RepoPath())
if err != nil {
log.Error("RestoreBranch: CreateBranch: %w", err)
ctx.Flash.Error(ctx.Tr("repo.branch.restore_failed", deletedBranch.Name))
return
}
objectFormat := git.ObjectFormatFromName(ctx.Repo.Repository.ObjectFormatName)
// Don't return error below this
if err := repo_service.PushUpdate(