From d171cd41b178874ce22791c07d35283b126ebdf3 Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 14 Jan 2020 23:11:08 +0000 Subject: [PATCH] Fix #9752 (#9769) --- 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 f774b375a52..c91f597f9a4 100644 --- a/modules/repofiles/delete.go +++ b/modules/repofiles/delete.go @@ -47,7 +47,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_module.GetBranch(repo, opts.NewBranch) - if git.IsErrNotExist(err) { + if err != nil && !git.IsErrBranchNotExist(err) { return nil, err } if newBranch != nil {