mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-17 01:42:45 +02:00
set --abbrev-commit to return 8-digit hash strings
This commit is contained in:
committed by
Jesse Duffield
parent
5af7b0235e
commit
a9fe0b8000
@ -105,7 +105,7 @@ func (c *CommitListBuilder) GetCommits(limit bool) ([]*Commit, error) {
|
|||||||
// now we can split it up and turn it into commits
|
// now we can split it up and turn it into commits
|
||||||
for _, line := range utils.SplitLines(log) {
|
for _, line := range utils.SplitLines(log) {
|
||||||
commit := c.extractCommitFromLine(line)
|
commit := c.extractCommitFromLine(line)
|
||||||
_, unpushed := unpushedCommits[commit.Sha[:7]]
|
_, unpushed := unpushedCommits[commit.Sha[:8]]
|
||||||
commit.Status = map[bool]string{true: "unpushed", false: "pushed"}[unpushed]
|
commit.Status = map[bool]string{true: "unpushed", false: "pushed"}[unpushed]
|
||||||
commits = append(commits, commit)
|
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
|
// to the remote branch of the current branch, a map is returned to ease look up
|
||||||
func (c *CommitListBuilder) getUnpushedCommits() map[string]bool {
|
func (c *CommitListBuilder) getUnpushedCommits() map[string]bool {
|
||||||
pushables := 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 {
|
if err != nil {
|
||||||
return pushables
|
return pushables
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user