Skip to content

Commit

Permalink
address PR review feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
  • Loading branch information
wagoodman committed Sep 18, 2023
1 parent 026036e commit 5f22364
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion chronicle/release/releasers/github/summarizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,6 @@ func gitTagCommit(t *testing.T, path, tag string) string {
func gitHeadCommit(t *testing.T, path string) string {
t.Helper()

// why the ~1? we want git log to return inclusive results
cmd := exec.Command("git", "--no-pager", "rev-parse", "HEAD")
cmd.Dir = path
output, err := cmd.Output()
Expand Down
3 changes: 3 additions & 0 deletions internal/git/first.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ func FirstCommit(repoPath string) (string, error) {
if err != nil {
return "", fmt.Errorf("unable to open repo: %w", err)
}

iter, err := r.Log(&git.LogOptions{})
if err != nil {
return "", fmt.Errorf("unable to log commits: %w", err)
}

// the iterator works just like "git log", which is in reverse chronological order. That means the
// first commit in the repo is the last item in the iterator.
var last string
err = iter.ForEach(func(c *object.Commit) error {
if c != nil {
Expand Down

0 comments on commit 5f22364

Please sign in to comment.