Browse Source

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.
tags/v1.21.12.1
마누엘 无闻 9 years ago
parent
commit
36a63dd059
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      models/release.go

+ 1
- 0
models/release.go View File

@@ -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)


Loading…
Cancel
Save