summaryrefslogtreecommitdiffstats
path: root/routers/private
diff options
context:
space:
mode:
authorJohn Olheiser <john.olheiser@gmail.com>2020-03-08 08:34:38 -0500
committerGitHub <noreply@github.com>2020-03-08 08:34:38 -0500
commitde63ac046ed50e5ca937fb63c50df01dc285425b (patch)
tree1f34e970348953c093b45e89e6f4b01ce5ba31c9 /routers/private
parentb40428a50add017d3977f3069c517050044aeb02 (diff)
downloadgitea-de63ac046ed50e5ca937fb63c50df01dc285425b.tar.gz
gitea-de63ac046ed50e5ca937fb63c50df01dc285425b.zip
Make PR message on pushes configurable (#10664)
* Make PR message on pushes configurable * Make fmt Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'routers/private')
-rw-r--r--routers/private/hook.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/private/hook.go b/routers/private/hook.go
index 1d8cb4b48e..6743d02e84 100644
--- a/routers/private/hook.go
+++ b/routers/private/hook.go
@@ -19,6 +19,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/repofiles"
+ "code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
pull_service "code.gitea.io/gitea/services/pull"
"gopkg.in/src-d/go-git.v4/plumbing"
@@ -428,14 +429,14 @@ func HookPostReceive(ctx *macaron.Context, opts private.HookOptions) {
branch = fmt.Sprintf("%s:%s", repo.OwnerName, branch)
}
results = append(results, private.HookPostReceiveBranchResult{
- Message: true,
+ Message: setting.Git.PullRequestPushMessage && repo.AllowsPulls(),
Create: true,
Branch: branch,
URL: fmt.Sprintf("%s/compare/%s...%s", baseRepo.HTMLURL(), util.PathEscapeSegments(baseRepo.DefaultBranch), util.PathEscapeSegments(branch)),
})
} else {
results = append(results, private.HookPostReceiveBranchResult{
- Message: true,
+ Message: setting.Git.PullRequestPushMessage && repo.AllowsPulls(),
Create: false,
Branch: branch,
URL: fmt.Sprintf("%s/pulls/%d", baseRepo.HTMLURL(), pr.Index),