Skip to content

Commit

Permalink
internal/git: add second ref to diffstat
Browse files Browse the repository at this point in the history
When the user uses --source pointing to a different source branch
compared to the HEAD he's sitting at the diffstat returns the wrong
information, since it's based on HEAD. This patch adds the second
argument to `git diff --stat` to indicate what's the reference it should
use for comparing with the merge base.

Signed-off-by: Bruno Meneguele <[email protected]>
  • Loading branch information
bmeneg committed Jun 24, 2021
1 parent 114b876 commit e371958
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func Log(sha1, sha2 string) (string, error) {
return "", errors.Errorf("Can't load git log %s..%s", sha1, sha2)
}

diffCmd := New("diff", "--stat", fmt.Sprintf("%s...", sha1))
diffCmd := New("diff", "--stat", fmt.Sprintf("%s...%s", sha1, sha2))
diffCmd.Stdout = nil
diffOutput, err := diffCmd.Output()
if err != nil {
Expand Down

0 comments on commit e371958

Please sign in to comment.