mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Correctly handle draft releases without a tag (#20314)
Fixes #20313. `errors.Is(err, git.ErrNotExist{})` is not working
This commit is contained in:
		| @@ -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) | ||||
| 				} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user