Skip to content

Commit

Permalink
Remove duplicate empty repo check in delete branch API (go-gitea#32569)
Browse files Browse the repository at this point in the history
Found while working on go-gitea#32433.

This branch will never be executed because we have would have already
made the same check a couple lines above.
  • Loading branch information
kemzeb authored Nov 20, 2024
1 parent 69268ee commit 355889d
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions routers/api/v1/repo/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 355889d

Please sign in to comment.