summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author마누엘 <nalla@hamal.uberspace.de>2016-07-28 04:45:35 +0200
committer无闻 <u@gogs.io>2016-07-28 10:45:35 +0800
commit36a63dd05913af4994e43bf6d66fd73b7d8e41ea (patch)
treeabc8f10df5a24922280530da65f39f18e9f28037
parent03ba257ad2e52a30e198deee4bfcd5e5d0fa9258 (diff)
downloadgitea-36a63dd05913af4994e43bf6d66fd73b7d8e41ea.tar.gz
gitea-36a63dd05913af4994e43bf6d66fd73b7d8e41ea.zip
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.
-rw-r--r--models/release.go1
1 files changed, 1 insertions, 0 deletions
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)