diff options
author | Earl Warren <contact@earl-warren.org> | 2024-03-25 16:54:38 +0100 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2024-03-26 16:51:56 +0100 |
commit | a117dfd2b1e37b36eb29b7d9cf1f59581697fd6b (patch) | |
tree | 1491440b40e73d43e6938744eeef2b979daf0e9c /routers | |
parent | [DEADCODE] update (diff) | |
download | forgejo-a117dfd2b1e37b36eb29b7d9cf1f59581697fd6b.tar.xz forgejo-a117dfd2b1e37b36eb29b7d9cf1f59581697fd6b.zip |
[ACTIONS] port scheduled actions from Gitea
Refs: https://codeberg.org/forgejo/forgejo/issues/2798
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/setting/default_branch.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/routers/web/repo/setting/default_branch.go b/routers/web/repo/setting/default_branch.go index 12e1ab7d1c..881d148afc 100644 --- a/routers/web/repo/setting/default_branch.go +++ b/routers/web/repo/setting/default_branch.go @@ -6,12 +6,11 @@ package setting import ( "net/http" - repo_model "code.gitea.io/gitea/models/repo" - "code.gitea.io/gitea/modules/git" - "code.gitea.io/gitea/modules/gitrepo" + git_model "code.gitea.io/gitea/models/git" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/routers/web/repo" + "code.gitea.io/gitea/services/context" repo_service "code.gitea.io/gitea/services/repository" ) @@ -37,7 +36,7 @@ func SetDefaultBranchPost(ctx *context.Context) { branch := ctx.FormString("branch") if err := repo_service.SetRepoDefaultBranch(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, branch); err != nil { switch { - case ctx.Repo.GitRepo.IsErrBranchNotExist(err): + case git_model.IsErrBranchNotExist(err): ctx.Status(http.StatusNotFound) default: ctx.ServerError("SetDefaultBranch", err) |