Skip to content

Commit

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

`errors.Is(err, git.ErrNotExist{})` is not working
  • Loading branch information
harryzcy authored Jul 12, 2022
1 parent 3aec32a commit 966e7bd
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 966e7bd

Please sign in to comment.