Compare commits

...
2 changed files with 6 additions and 3 deletions
+4 -2
View File
@@ -546,7 +546,9 @@ func setCommitStatuses(unpushedCommitHashes *set.Set[string], unmergedCommitHash
}
if unmergedCommitHashes == nil || unmergedCommitHashes.Includes(commit.Hash()) {
if unpushedCommitHashes != nil && unpushedCommitHashes.Includes(commit.Hash()) {
if unpushedCommitHashes == nil {
commits[i].Status = models.StatusNone
} else if unpushedCommitHashes.Includes(commit.Hash()) {
commits[i].Status = models.StatusUnpushed
} else {
commits[i].Status = models.StatusPushed
@@ -569,7 +571,7 @@ func (self *CommitLoader) getReachableHashes(refName string, notRefNames []strin
DontLog().
RunWithOutputs()
if err != nil {
return set.New[string]()
return nil
}
return set.NewFromSlice(utils.SplitLines(output))
+2 -1
View File
@@ -483,6 +483,8 @@ func getHashColor(
diffed := commit.Hash() != "" && commit.Hash() == diffName
hashColor := theme.DefaultTextColor
switch commit.Status {
case models.StatusNone:
hashColor = style.FgMagenta // or style.FgCyan
case models.StatusUnpushed:
hashColor = style.FgRed
case models.StatusPushed:
@@ -493,7 +495,6 @@ func getHashColor(
hashColor = style.FgBlue
case models.StatusReflog:
hashColor = style.FgBlue
default:
}
if diffed {