From 602c5da9530a56e61b76794cbc9af663ef863473 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 15 Jan 2020 01:41:28 +0100 Subject: [PATCH] Fix #9752 (#9769) (#9775) Co-authored-by: zeripath --- modules/repofiles/delete.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/repofiles/delete.go b/modules/repofiles/delete.go index 43937c49e..570838bcd 100644 --- a/modules/repofiles/delete.go +++ b/modules/repofiles/delete.go @@ -46,7 +46,7 @@ func DeleteRepoFile(repo *models.Repository, doer *models.User, opts *DeleteRepo // If we aren't branching to a new branch, make sure user can commit to the given branch if opts.NewBranch != opts.OldBranch { newBranch, err := repo.GetBranch(opts.NewBranch) - if git.IsErrNotExist(err) { + if err != nil && !git.IsErrBranchNotExist(err) { return nil, err } if newBranch != nil {