Skip to content

Commit

Permalink
Correctly handle draft releases without a tag (#20314) (#20335)
Browse files Browse the repository at this point in the history
Backport #20314

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

Fixes #20313

Co-authored-by: Chongyi Zheng <harry@harryzheng.com>
  • Loading branch information
zeripath and harryzcy authored Jul 12, 2022
1 parent b8ab929 commit 26f4fe2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions services/migrations/gitea_uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package migrations

import (
"context"
"errors"
"fmt"
"io"
"os"
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 26f4fe2

Please sign in to comment.