Delete local branch if it exists (#6497)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
parent
49b2f45f75
commit
aa02463ded
2 changed files with 38 additions and 0 deletions
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue