mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Delete local branch if it exists (#6497)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user