Correctly handle draft releases without a tag (#20314)
Fixes #20313. `errors.Is(err, git.ErrNotExist{})` is not working
This commit is contained in:
parent
3aec32ad16
commit
966e7bdc9b
1 changed files with 1 additions and 2 deletions
|
@ -7,7 +7,6 @@ package migrations
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
@ -268,7 +267,7 @@ func (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error {
|
||||||
// calc NumCommits if possible
|
// calc NumCommits if possible
|
||||||
if rel.TagName != "" {
|
if rel.TagName != "" {
|
||||||
commit, err := g.gitRepo.GetTagCommit(rel.TagName)
|
commit, err := g.gitRepo.GetTagCommit(rel.TagName)
|
||||||
if !errors.Is(err, git.ErrNotExist{}) {
|
if !git.IsErrNotExist(err) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("GetTagCommit[%v]: %v", rel.TagName, err)
|
return fmt.Errorf("GetTagCommit[%v]: %v", rel.TagName, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue