mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
Fix NPE on try to get tag reference via API (#18245)
* fix npe * rm gitRepo from Tag
This commit is contained in:
@@ -17,7 +17,6 @@ const endpgp = "\n-----END PGP SIGNATURE-----"
|
||||
type Tag struct {
|
||||
Name string
|
||||
ID SHA1
|
||||
repo *Repository
|
||||
Object SHA1 // The id of this commit object
|
||||
Type string
|
||||
Tagger *Signature
|
||||
@@ -26,8 +25,8 @@ type Tag struct {
|
||||
}
|
||||
|
||||
// Commit return the commit of the tag reference
|
||||
func (tag *Tag) Commit() (*Commit, error) {
|
||||
return tag.repo.getCommit(tag.Object)
|
||||
func (tag *Tag) Commit(gitRepo *Repository) (*Commit, error) {
|
||||
return gitRepo.getCommit(tag.Object)
|
||||
}
|
||||
|
||||
// Parse commit information from the (uncompressed) raw
|
||||
|
Reference in New Issue
Block a user