aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/repo.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-11-02 19:20:22 +0800
committerGitHub <noreply@github.com>2024-11-02 11:20:22 +0000
commite524f63d58900557d7d57fc3bcd19d9facc8b8ee (patch)
tree205126f1134cce89b2a19faff2f1cfc48ad61adb /routers/api/v1/repo/repo.go
parent13a203828c40f9ad1005b16b4ae26256a7df8263 (diff)
downloadgitea-e524f63d58900557d7d57fc3bcd19d9facc8b8ee.tar.gz
gitea-e524f63d58900557d7d57fc3bcd19d9facc8b8ee.zip
Fix git error handling (#32401)
Diffstat (limited to 'routers/api/v1/repo/repo.go')
-rw-r--r--routers/api/v1/repo/repo.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index 698ba3cc94..69a95dd5a5 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -21,7 +21,6 @@ import (
repo_model "code.gitea.io/gitea/models/repo"
unit_model "code.gitea.io/gitea/models/unit"
user_model "code.gitea.io/gitea/models/user"
- "code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/gitrepo"
"code.gitea.io/gitea/modules/label"
"code.gitea.io/gitea/modules/log"
@@ -739,10 +738,8 @@ func updateBasicProperties(ctx *context.APIContext, opts api.EditRepoOption) err
if opts.DefaultBranch != nil && repo.DefaultBranch != *opts.DefaultBranch && (repo.IsEmpty || ctx.Repo.GitRepo.IsBranchExist(*opts.DefaultBranch)) {
if !repo.IsEmpty {
if err := gitrepo.SetDefaultBranch(ctx, ctx.Repo.Repository, *opts.DefaultBranch); err != nil {
- if !git.IsErrUnsupportedVersion(err) {
- ctx.Error(http.StatusInternalServerError, "SetDefaultBranch", err)
- return err
- }
+ ctx.Error(http.StatusInternalServerError, "SetDefaultBranch", err)
+ return err
}
updateRepoLicense = true
}