mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-30 22:06:11 +01:00
Backport #20314 `errors.Is(err, git.ErrNotExist{})` is not working Fixes #20313 Co-authored-by: Chongyi Zheng <harry@harryzheng.com>
This commit is contained in:
parent
b8ab9298e1
commit
26f4fe2b44
|
@ -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