Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
errordeveloper committed Oct 9, 2023
1 parent 7ecc307 commit cb8a27d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions attest/vcs/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,14 @@ func (c *PathChecker) MakeSummary() (types.PathCheckSummary, error) {
object.NewCommitIterCTime(headCommit, nil, nil),
true,
)

if err := commitIter.ForEach(func(commit *object.Commit) error {
if obj.CommitHash != "" {
return nil
}
defer commitIter.Close()
// only need first commit, avoid looping over all commits with ForEach
commit, err := commitIter.Next()
if err == nil {
obj.CommitHash = commit.Hash.String()
return nil

}); err != nil {
} else if err != io.EOF {
return nil, err
}

defer commitIter.Close()
}

tags, err := c.cache.repo.Tags()
Expand All @@ -232,7 +227,6 @@ func (c *PathChecker) MakeSummary() (types.PathCheckSummary, error) {
}

if err := tags.ForEach(func(t *plumbing.Reference) error {

target, err := c.cache.repo.ResolveRevision(plumbing.Revision(t.Name()))
if err != nil {
return err
Expand Down

0 comments on commit cb8a27d

Please sign in to comment.