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.

(cherry picked from commit 355889dbc2432554f0bcdb22f918488849f0016c)
This commit is contained in:
Kemal Zebari 2024-11-19 17:05:06 -08:00 committed by Earl Warren
parent f3afd18b76
commit e9928b7577
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -133,11 +133,6 @@ func DeleteBranch(ctx *context.APIContext) {
branchName := ctx.Params("*") branchName := ctx.Params("*")
if ctx.Repo.Repository.IsEmpty {
ctx.Error(http.StatusForbidden, "", "Git Repository is empty.")
return
}
// check whether branches of this repository has been synced // check whether branches of this repository has been synced
totalNumOfBranches, err := db.Count[git_model.Branch](ctx, git_model.FindBranchOptions{ totalNumOfBranches, err := db.Count[git_model.Branch](ctx, git_model.FindBranchOptions{
RepoID: ctx.Repo.Repository.ID, RepoID: ctx.Repo.Repository.ID,