]> source.dussan.org Git - gitea.git/commitdiff
Remove duplicate empty repo check in delete branch API (#32569)
authorKemal Zebari <60799661+kemzeb@users.noreply.github.com>
Wed, 20 Nov 2024 01:05:06 +0000 (17:05 -0800)
committerGitHub <noreply@github.com>
Wed, 20 Nov 2024 01:05:06 +0000 (01:05 +0000)
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.

routers/api/v1/repo/branch.go

index bb16858c8116026b2f7c8003dba2d27b4ad2ff4e..1cea7d8c72e2eb2e7ab8e7245d547fbfa9e1c5a1 100644 (file)
@@ -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,