aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
authorKemal Zebari <60799661+kemzeb@users.noreply.github.com>2024-11-19 17:05:06 -0800
committerGitHub <noreply@github.com>2024-11-20 01:05:06 +0000
commit355889dbc2432554f0bcdb22f918488849f0016c (patch)
treef5d0ce920ea45d5a1fe9856d5f24572425e28bd5 /routers/api/v1
parent69268ee19f7fc33f6d3ea3a3a7eb4a000e825863 (diff)
downloadgitea-355889dbc2432554f0bcdb22f918488849f0016c.tar.gz
gitea-355889dbc2432554f0bcdb22f918488849f0016c.zip
Remove duplicate empty repo check in delete branch API (#32569)
Found while working on #32433. This branch will never be executed because we have would have already made the same check a couple lines above.
Diffstat (limited to 'routers/api/v1')
-rw-r--r--routers/api/v1/repo/branch.go5
1 files changed, 0 insertions, 5 deletions
diff --git a/routers/api/v1/repo/branch.go b/routers/api/v1/repo/branch.go
index bb16858c81..1cea7d8c72 100644
--- a/routers/api/v1/repo/branch.go
+++ b/routers/api/v1/repo/branch.go
@@ -133,11 +133,6 @@ func DeleteBranch(ctx *context.APIContext) {
branchName := ctx.PathParam("*")
- if ctx.Repo.Repository.IsEmpty {
- ctx.Error(http.StatusForbidden, "", "Git Repository is empty.")
- return
- }
-
// check whether branches of this repository has been synced
totalNumOfBranches, err := db.Count[git_model.Branch](ctx, git_model.FindBranchOptions{
RepoID: ctx.Repo.Repository.ID,