This commit is contained in:
Lunny Xiao 2024-12-02 23:49:57 -08:00
parent 17956ae24a
commit f52a57dcd5
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A

View File

@ -75,6 +75,8 @@ func CreateBranchFromIssue(ctx *context.Context) {
case git_model.IsErrBranchNameConflict(err):
e := err.(git_model.ErrBranchNameConflict)
ctx.JSONError(ctx.Tr("repo.branch.branch_name_conflict", form.NewBranchName, e.BranchName))
case git_model.IsErrBranchNotExist(err):
ctx.JSONError(ctx.Tr("repo.branch.branch_not_exist", form.SourceBranchName))
case git.IsErrPushRejected(err):
e := err.(*git.ErrPushRejected)
if len(e.Message) == 0 {
@ -107,6 +109,6 @@ func CreateBranchFromIssue(ctx *context.Context) {
return
}
ctx.Flash.Success(ctx.Tr("repo.issues.create_branch_from_issue_success", ctx.Repo.BranchName))
ctx.Flash.Success(ctx.Tr("repo.issues.create_branch_from_issue_success", form.NewBranchName))
ctx.JSONRedirect(issue.Link())
}