Skip to content

Commit

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

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

Fixes go-gitea#20313
  • Loading branch information
harryzcy authored and zeripath committed Jul 12, 2022
1 parent b8ab929 commit 2c5ccf0
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 2c5ccf0

Please sign in to comment.