Delete local branch if it exists (#6497)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
John Olheiser 2019-04-08 00:08:02 -05:00 committed by Lauris BH
parent 49b2f45f75
commit aa02463ded
2 changed files with 38 additions and 0 deletions

View file

@ -71,6 +71,12 @@ func DeleteBranchPost(ctx *context.Context) {
return
}
// Delete branch in local copy if it exists
if err := ctx.Repo.Repository.DeleteLocalBranch(branchName); err != nil {
ctx.Flash.Error(ctx.Tr("repo.branch.deletion_failed", branchName))
return
}
ctx.Flash.Success(ctx.Tr("repo.branch.deletion_success", branchName))
}