diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2021-12-29 12:40:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-29 19:40:57 +0800 |
commit | 8fa97a25f0dccc4db94d344ce7af632f8fe358b0 (patch) | |
tree | 0fc19177c4acef19ee8cc2be6ee1df1e8099d544 /services/release | |
parent | 72f9050689912f5910a08d593ebe53078fe85aa4 (diff) | |
download | gitea-8fa97a25f0dccc4db94d344ce7af632f8fe358b0.tar.gz gitea-8fa97a25f0dccc4db94d344ce7af632f8fe358b0.zip |
Set HeadCommit when creating tags. (#18116)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'services/release')
-rw-r--r-- | services/release/release.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/release/release.go b/services/release/release.go index e20b91ece0..5fa506bc61 100644 --- a/services/release/release.go +++ b/services/release/release.go @@ -72,13 +72,17 @@ func createTag(gitRepo *git.Repository, rel *models.Release, msg string) (bool, created = true rel.LowerTagName = strings.ToLower(rel.TagName) + commits := repository.NewPushCommits() + commits.HeadCommit = repository.CommitToPushCommit(commit) + commits.CompareURL = rel.Repo.ComposeCompareURL(git.EmptySHA, commit.ID.String()) + notification.NotifyPushCommits( rel.Publisher, rel.Repo, &repository.PushUpdateOptions{ RefFullName: git.TagPrefix + rel.TagName, OldCommitID: git.EmptySHA, NewCommitID: commit.ID.String(), - }, repository.NewPushCommits()) + }, commits) notification.NotifyCreateRef(rel.Publisher, rel.Repo, "tag", git.TagPrefix+rel.TagName) rel.CreatedUnix = timeutil.TimeStampNow() } |