1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-15 14:08:28 +00:00

Correctly handle draft releases without a tag (#20314) (#20335)

Backport #20314

`errors.Is(err, git.ErrNotExist{})` is not working

Fixes #20313

Co-authored-by: Chongyi Zheng <harry@harryzheng.com>
This commit is contained in:
zeripath
2022-07-12 19:55:25 +01:00
committed by GitHub
parent b8ab9298e1
commit 26f4fe2b44

View File

@@ -7,7 +7,6 @@ package migrations
import (
"context"
"errors"
"fmt"
"io"
"os"
@@ -268,7 +267,7 @@ func (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error {
// calc NumCommits if possible
if rel.TagName != "" {
commit, err := g.gitRepo.GetTagCommit(rel.TagName)
if !errors.Is(err, git.ErrNotExist{}) {
if !git.IsErrNotExist(err) {
if err != nil {
return fmt.Errorf("GetTagCommit[%v]: %v", rel.TagName, err)
}