aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChongyi Zheng <harry@harryzheng.com>2022-07-12 08:57:38 -0400
committerGitHub <noreply@github.com>2022-07-12 13:57:38 +0100
commit966e7bdc9b875abb7192cd572beec40123a815da (patch)
tree96ea06364ca9ea16715a6eec6e11470224782241
parent3aec32ad16402c4c93c3e199f270645069c7ad37 (diff)
downloadgitea-966e7bdc9b875abb7192cd572beec40123a815da.tar.gz
gitea-966e7bdc9b875abb7192cd572beec40123a815da.zip
Correctly handle draft releases without a tag (#20314)
Fixes #20313. `errors.Is(err, git.ErrNotExist{})` is not working
-rw-r--r--services/migrations/gitea_uploader.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/services/migrations/gitea_uploader.go b/services/migrations/gitea_uploader.go
index e71b2ca17a..c7a6f9b02f 100644
--- a/services/migrations/gitea_uploader.go
+++ b/services/migrations/gitea_uploader.go
@@ -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)
}