From 36a63dd05913af4994e43bf6d66fd73b7d8e41ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A7=88=EB=88=84=EC=97=98?= Date: Thu, 28 Jul 2016 04:45:35 +0200 Subject: [PATCH] models/release: Update Sha1 if tag already exists (#3331) Since the release struct is initialized with the current `HEAD` of the current `release.Target` the commit id has to be updated if the tag commit already exists. Otherwise the linked commit on the release page will target the current `HEAD` at release time. --- models/release.go | 1 + 1 file changed, 1 insertion(+) diff --git a/models/release.go b/models/release.go index 274776b5c4..b38c2f5259 100644 --- a/models/release.go +++ b/models/release.go @@ -81,6 +81,7 @@ func createTag(gitRepo *git.Repository, rel *Release) error { return fmt.Errorf("GetTagCommit: %v", err) } + rel.Sha1 = commit.ID.String() rel.NumCommits, err = commit.CommitsCount() if err != nil { return fmt.Errorf("CommitsCount: %v", err)