if err != nil {
return nil, err
}
- tag.repo = repo
- commit, err := tag.Commit()
+ commit, err := tag.Commit(repo)
if err != nil {
return nil, err
}
Type: tp,
Tagger: commit.Committer,
Message: commit.Message(),
- repo: repo,
}
repo.tagCache.Set(tagID.String(), tag)
tag.Name = name
tag.ID = tagID
- tag.repo = repo
tag.Type = tp
repo.tagCache.Set(tagID.String(), tag)
if lTag == nil {
assert.FailNow(t, "nil lTag: %s", lTagName)
}
- lTag.repo = nil
assert.EqualValues(t, lTagName, lTag.Name)
assert.EqualValues(t, lTagCommitID, lTag.ID.String())
assert.EqualValues(t, lTagCommitID, lTag.Object.String())
if err != nil {
return nil, err
}
- commit, err := tag.Commit()
+ commit, err := tag.Commit(repo)
if err != nil {
return nil, err
}
type Tag struct {
Name string
ID SHA1
- repo *Repository
Object SHA1 // The id of this commit object
Type string
Tagger *Signature
}
// 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
`), tag: Tag{
Name: "",
ID: SHA1{},
- repo: nil,
Object: SHA1{0x3b, 0x11, 0x4a, 0xb8, 0x0, 0xc6, 0x43, 0x2a, 0xd4, 0x23, 0x87, 0xcc, 0xf6, 0xbc, 0x8d, 0x43, 0x88, 0xa2, 0x88, 0x5a},
Type: "commit",
Tagger: &Signature{Name: "Lucas Michot", Email: "lucas@semalead.com", When: time.Unix(1484491741, 0)},
ono`), tag: Tag{
Name: "",
ID: SHA1{},
- repo: nil,
Object: SHA1{0x7c, 0xdf, 0x42, 0xc0, 0xb1, 0xcc, 0x76, 0x3a, 0xb7, 0xe4, 0xc3, 0x3c, 0x47, 0xa2, 0x4e, 0x27, 0xc6, 0x6b, 0xfc, 0xcc},
Type: "commit",
Tagger: &Signature{Name: "Lucas Michot", Email: "lucas@semalead.com", When: time.Unix(1484553735, 0)},
if err != nil {
return fmt.Errorf("GetTag: %v", err)
}
- commit, err := tag.Commit()
+ commit, err := tag.Commit(gitRepo)
if err != nil {
return fmt.Errorf("Commit: %v", err)
}
if tag, err := ctx.Repo.GitRepo.GetAnnotatedTag(sha); err != nil {
ctx.Error(http.StatusBadRequest, "GetAnnotatedTag", err)
} else {
- commit, err := tag.Commit()
+ commit, err := tag.Commit(ctx.Repo.GitRepo)
if err != nil {
ctx.Error(http.StatusBadRequest, "GetAnnotatedTag", err)
}
if err != nil {
return fmt.Errorf("GetTag: %v", err)
}
- commit, err := tag.Commit()
+ commit, err := tag.Commit(gitRepo)
if err != nil {
return fmt.Errorf("Commit: %v", err)
}