Skip to content

Commit 355889d

Browse files
authored
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.
1 parent 69268ee commit 355889d

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

routers/api/v1/repo/branch.go

-5
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,6 @@ func DeleteBranch(ctx *context.APIContext) {
133133

134134
branchName := ctx.PathParam("*")
135135

136-
if ctx.Repo.Repository.IsEmpty {
137-
ctx.Error(http.StatusForbidden, "", "Git Repository is empty.")
138-
return
139-
}
140-
141136
// check whether branches of this repository has been synced
142137
totalNumOfBranches, err := db.Count[git_model.Branch](ctx, git_model.FindBranchOptions{
143138
RepoID: ctx.Repo.Repository.ID,

0 commit comments

Comments
 (0)