Skip to content

Commit

Permalink
🐛🔨 Include commit SHA even if other data isn't available
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrudolph committed Feb 19, 2021
1 parent 999d969 commit a91214d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/metadata/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,14 @@ type emptyCommitResolver struct {
}

// NewEmptyCommitResolver returns a CommitResolver whose Lookup method always
// produces an empty Commit.
// produces a Commit that only contains the given commit SHA and no other
// metadata.
func NewEmptyCommitResolver(logger logger.Logger) CommitResolver {
return &emptyCommitResolver{logger: logger}
}

func (e *emptyCommitResolver) Lookup(sha string) (*Commit, error) {
return &Commit{}, nil
return &Commit{SHA: sha}, nil
}

func (e *emptyCommitResolver) Source() string {
Expand Down

0 comments on commit a91214d

Please sign in to comment.