From a9fe0b80008dbeec196115fe5cc36535f19f5316 Mon Sep 17 00:00:00 2001 From: David Chen Date: Wed, 26 Feb 2020 18:40:54 -0800 Subject: set --abbrev-commit to return 8-digit hash strings --- pkg/commands/commit_list_builder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/commands/commit_list_builder.go b/pkg/commands/commit_list_builder.go index d4dce7433..a31657b34 100644 --- a/pkg/commands/commit_list_builder.go +++ b/pkg/commands/commit_list_builder.go @@ -105,7 +105,7 @@ func (c *CommitListBuilder) GetCommits(limit bool) ([]*Commit, error) { // now we can split it up and turn it into commits for _, line := range utils.SplitLines(log) { commit := c.extractCommitFromLine(line) - _, unpushed := unpushedCommits[commit.Sha[:7]] + _, unpushed := unpushedCommits[commit.Sha[:8]] commit.Status = map[bool]string{true: "unpushed", false: "pushed"}[unpushed] commits = append(commits, commit) } @@ -298,7 +298,7 @@ func (c *CommitListBuilder) getMergeBase() (string, error) { // to the remote branch of the current branch, a map is returned to ease look up func (c *CommitListBuilder) getUnpushedCommits() map[string]bool { pushables := map[string]bool{} - o, err := c.OSCommand.RunCommandWithOutput("git rev-list @{u}..HEAD --abbrev-commit") + o, err := c.OSCommand.RunCommandWithOutput("git rev-list @{u}..HEAD --abbrev-commit --abbrev=8") if err != nil { return pushables } -- cgit v1.2.3