mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
* Fixes #12341: Release date should only be set to current time if draft or tag created * Removes old date set * Adds unit tests * make fmt * Fixes tests * Adds sleep for comparing times * Adds sleep for comparing times * Fixes tests Co-authored-by: Matti R <matti@mdranta.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
@@ -46,6 +46,7 @@ func createTag(gitRepo *git.Repository, rel *models.Release) error {
|
||||
rel.Publisher, rel.Repo, git.TagPrefix+rel.TagName,
|
||||
git.EmptySHA, commit.ID.String(), repository.NewPushCommits())
|
||||
notification.NotifyCreateRef(rel.Publisher, rel.Repo, "tag", git.TagPrefix+rel.TagName)
|
||||
rel.CreatedUnix = timeutil.TimeStampNow()
|
||||
}
|
||||
commit, err := gitRepo.GetTagCommit(rel.TagName)
|
||||
if err != nil {
|
||||
@@ -53,7 +54,6 @@ func createTag(gitRepo *git.Repository, rel *models.Release) error {
|
||||
}
|
||||
|
||||
rel.Sha1 = commit.ID.String()
|
||||
rel.CreatedUnix = timeutil.TimeStampNow()
|
||||
rel.NumCommits, err = commit.CommitsCount()
|
||||
if err != nil {
|
||||
return fmt.Errorf("CommitsCount: %v", err)
|
||||
|
Reference in New Issue
Block a user