summaryrefslogtreecommitdiffstats
path: root/services/repository
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2021-06-29 15:34:03 +0200
committerGitHub <noreply@github.com>2021-06-29 15:34:03 +0200
commitaac663e0da0af644ae1011d268d027160265dce3 (patch)
treee2001118696d507561664349a27d7b9fca7d01ed /services/repository
parent579fcad8cdd16e88edc60685fbf9b555266bac76 (diff)
downloadgitea-aac663e0da0af644ae1011d268d027160265dce3.tar.gz
gitea-aac663e0da0af644ae1011d268d027160265dce3.zip
Implemented head_commit for webhooks (#16282)
* Removed Len field. * Added head_commit webhook field. * Added comment for returns.
Diffstat (limited to 'services/repository')
-rw-r--r--services/repository/push.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/repository/push.go b/services/repository/push.go
index dcb3bc779f..26df6b8e45 100644
--- a/services/repository/push.go
+++ b/services/repository/push.go
@@ -95,7 +95,6 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
if opts.IsNewRef() && opts.IsDelRef() {
return fmt.Errorf("Old and new revisions are both %s", git.EmptySHA)
}
- var commits = &repo_module.PushCommits{}
if opts.IsTag() { // If is tag reference
if pusher == nil || pusher.ID != opts.PusherID {
var err error
@@ -192,7 +191,8 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
}
}
- commits = repo_module.ListToPushCommits(l)
+ commits := repo_module.ListToPushCommits(l)
+ commits.HeadCommit = repo_module.CommitToPushCommit(newCommit)
if err := repofiles.UpdateIssuesCommit(pusher, repo, commits.Commits, refName); err != nil {
log.Error("updateIssuesCommit: %v", err)