mirror of
https://github.com/go-gitea/gitea.git
synced 2025-11-29 15:47:33 +01:00
Don't show unnecessary error message to end users for DeleteBranchAfterMerge (#35937)
This commit is contained in:
parent
372d24b84b
commit
b95fd7e13e
@ -1243,7 +1243,11 @@ func MergePullRequest(ctx *context.Context) {
|
|||||||
func deleteBranchAfterMergeAndFlashMessage(ctx *context.Context, prID int64) {
|
func deleteBranchAfterMergeAndFlashMessage(ctx *context.Context, prID int64) {
|
||||||
var fullBranchName string
|
var fullBranchName string
|
||||||
err := repo_service.DeleteBranchAfterMerge(ctx, ctx.Doer, prID, &fullBranchName)
|
err := repo_service.DeleteBranchAfterMerge(ctx, ctx.Doer, prID, &fullBranchName)
|
||||||
if errTr := util.ErrorAsTranslatable(err); errTr != nil {
|
if errors.Is(err, util.ErrPermissionDenied) || errors.Is(err, util.ErrNotExist) {
|
||||||
|
// no need to show error to end users if no permission or branch not exist
|
||||||
|
log.Debug("DeleteBranchAfterMerge (ignore unnecessary error): %v", err)
|
||||||
|
return
|
||||||
|
} else if errTr := util.ErrorAsTranslatable(err); errTr != nil {
|
||||||
ctx.Flash.Error(errTr.Translate(ctx.Locale))
|
ctx.Flash.Error(errTr.Translate(ctx.Locale))
|
||||||
return
|
return
|
||||||
} else if err == nil {
|
} else if err == nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user