Skip to content

Commit 32a320d

Browse files
committed
fix: agit prompt to create pull request
template error for block user alert
1 parent 7d3673a commit 32a320d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

cmd/hook.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,8 @@ Gitea or set your environment appropriately.`, "")
705705

706706
if err == nil {
707707
for _, res := range resp.Results {
708-
hookPrintResult(res.ShouldShowMessage, res.IsCreatePR, res.HeadBranch, res.URL)
708+
// AGit always creates a pull request so there is no point is prompting user to create one
709+
hookPrintResult(res.ShouldShowMessage, false, res.HeadBranch, res.URL)
709710
}
710711
}
711712

routers/web/repo/pull.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,6 +1356,7 @@ func CompareAndPullRequestPost(ctx *context.Context) {
13561356
flashError, err := ctx.RenderToHTML(tplAlertDetails, map[string]any{
13571357
"Message": ctx.Tr("repo.pulls.push_rejected"),
13581358
"Summary": ctx.Tr("repo.pulls.new.blocked_user"),
1359+
"Details": "",
13591360
})
13601361
if err != nil {
13611362
ctx.ServerError("CompareAndPullRequest.HTMLString", err)
@@ -1366,6 +1367,7 @@ func CompareAndPullRequestPost(ctx *context.Context) {
13661367
flashError, err := ctx.RenderToHTML(tplAlertDetails, map[string]any{
13671368
"Message": ctx.Tr("repo.pulls.push_rejected"),
13681369
"Summary": ctx.Tr("repo.pulls.new.must_collaborator"),
1370+
"Details": "",
13691371
})
13701372
if err != nil {
13711373
ctx.ServerError("CompareAndPullRequest.HTMLString", err)

0 commit comments

Comments
 (0)