Skip to content

Commit 844db28

Browse files
committed
remove unnecessary condition
1 parent 670a689 commit 844db28

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

routers/api/v1/repo/branch.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,7 @@ func CreateBranch(ctx *context.APIContext) {
176176
var oldCommit *git.Commit
177177
var err error
178178

179-
if len(opt.OldRefName) > 0 && len(opt.OldBranchName) > 0 {
180-
ctx.Error(http.StatusInternalServerError, "", "OldRefName And OldBranchName can not be both exist.")
181-
return
182-
} else if len(opt.OldRefName) > 0 {
179+
if len(opt.OldRefName) > 0 {
183180
if ctx.Repo.GitRepo.IsBranchExist(opt.OldRefName) {
184181
oldCommit, err = ctx.Repo.GitRepo.GetBranchCommit(opt.OldRefName)
185182
if err != nil {

0 commit comments

Comments
 (0)