mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-03 09:52:26 +02: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:
parent
cd7f1fd72b
commit
8a36c46a7e
2 changed files with 152 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue