summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/presentation')
-rw-r--r--pkg/gui/presentation/commits.go26
-rw-r--r--pkg/gui/presentation/commits_test.go276
-rw-r--r--pkg/gui/presentation/graph/graph.go20
-rw-r--r--pkg/gui/presentation/reflog_commits.go4
4 files changed, 163 insertions, 163 deletions
diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go
index 58f465196..d6ae519c2 100644
--- a/pkg/gui/presentation/commits.go
+++ b/pkg/gui/presentation/commits.go
@@ -22,7 +22,7 @@ import (
)
type pipeSetCacheKey struct {
- commitSha string
+ commitHash string
commitCount int
}
@@ -43,14 +43,14 @@ func GetCommitListDisplayStrings(
currentBranchName string,
hasRebaseUpdateRefsConfig bool,
fullDescription bool,
- cherryPickedCommitShaSet *set.Set[string],
+ cherryPickedCommitHashSet *set.Set[string],
diffName string,
markedBaseCommit string,
timeFormat string,
shortTimeFormat string,
now time.Time,
parseEmoji bool,
- selectedCommitSha string,
+ selectedCommitHash string,
startIdx int,
endIdx int,
showGraph bool,
@@ -89,7 +89,7 @@ func GetCommitListDisplayStrings(
graphLines := graph.RenderAux(
graphPipeSets,
graphCommits,
- selectedCommitSha,
+ selectedCommitHash,
)
getGraphLine = func(idx int) string {
if idx >= graphOffset {
@@ -146,7 +146,7 @@ func GetCommitListDisplayStrings(
commit,
branchHeadsToVisualize,
hasRebaseUpdateRefsConfig,
- cherryPickedCommitShaSet,
+ cherryPickedCommitHashSet,
isMarkedBaseCommit,
willBeRebased,
diffName,
@@ -203,7 +203,7 @@ func loadPipesets(commits []*models.Commit) [][]*graph.Pipe {
// given that our cache key is a commit hash and a commit count, it's very important that we don't actually try to render pipes
// when dealing with things like filtered commits.
cacheKey := pipeSetCacheKey{
- commitSha: commits[0].Sha,
+ commitHash: commits[0].Sha,
commitCount: len(commits),
}
@@ -236,16 +236,16 @@ const (
BisectStatusCurrent
)
-func getBisectStatus(index int, commitSha string, bisectInfo *git_commands.BisectInfo, bisectBounds *bisectBounds) BisectStatus {
+func getBisectStatus(index int, commitHash string, bisectInfo *git_commands.BisectInfo, bisectBounds *bisectBounds) BisectStatus {
if !bisectInfo.Started() {
return BisectStatusNone
}
- if bisectInfo.GetCurrentSha() == commitSha {
+ if bisectInfo.GetCurrentSha() == commitHash {
return BisectStatusCurrent
}
- status, ok := bisectInfo.Status(commitSha)
+ status, ok := bisectInfo.Status(commitHash)
if ok {
switch status {
case git_commands.BisectStatusNew:
@@ -298,7 +298,7 @@ func displayCommit(
commit *models.Commit,
branchHeadsToVisualize *set.Set[string],
hasRebaseUpdateRefsConfig bool,
- cherryPickedCommitShaSet *set.Set[string],
+ cherryPickedCommitHashSet *set.Set[string],
isMarkedBaseCommit bool,
willBeRebased bool,
diffName string,
@@ -312,7 +312,7 @@ func displayCommit(
bisectInfo *git_commands.BisectInfo,
isYouAreHereCommit bool,
) []string {
- shaColor := getShaColor(commit, diffName, cherryPickedCommitShaSet, bisectStatus, bisectInfo)
+ shaColor := getShaColor(commit, diffName, cherryPickedCommitHashSet, bisectStatus, bisectInfo)
bisectString := getBisectStatusText(bisectStatus, bisectInfo)
actionString := ""
@@ -413,7 +413,7 @@ func getBisectStatusColor(status BisectStatus) style.TextStyle {
func getShaColor(
commit *models.Commit,
diffName string,
- cherryPickedCommitShaSet *set.Set[string],
+ cherryPickedCommitHashSet *set.Set[string],
bisectStatus BisectStatus,
bisectInfo *git_commands.BisectInfo,
) style.TextStyle {
@@ -439,7 +439,7 @@ func getShaColor(
if diffed {
shaColor = theme.DiffTerminalColor
- } else if cherryPickedCommitShaSet.Includes(commit.Sha) {
+ } else if cherryPickedCommitHashSet.Includes(commit.Sha) {
shaColor = theme.CherryPickedCommitTextStyle
} else if commit.Divergence == models.DivergenceRight && commit.Status != models.StatusMerged {
shaColor = style.FgBlue
diff --git a/pkg/gui/presentation/commits_test.go b/pkg/gui/presentation/commits_test.go
index f1f075f45..75f96eed9 100644
--- a/pkg/gui/presentation/commits_test.go
+++ b/pkg/gui/presentation/commits_test.go
@@ -22,38 +22,38 @@ func formatExpected(expected string) string {
func TestGetCommitListDisplayStrings(t *testing.T) {
scenarios := []struct {
- testName string
- commits []*models.Commit
- branches []*models.Branch
- currentBranchName string
- hasUpdateRefConfig bool
- fullDescription bool
- cherryPickedCommitShaSet *set.Set[string]
- markedBaseCommit string
- diffName string
- timeFormat string
- shortTimeFormat string
- now time.Time
- parseEmoji bool
- selectedCommitSha string
- startIdx int
- endIdx int
- showGraph bool
- bisectInfo *git_commands.BisectInfo
- showYouAreHereLabel bool
- expected string
- focus bool
+ testName string
+ commits []*models.Commit
+ branches []*models.Branch
+ currentBranchName string
+ hasUpdateRefConfig bool
+ fullDescription bool
+ cherryPickedCommitHashSet *set.Set[string]
+ markedBaseCommit string
+ diffName string
+ timeFormat string
+ shortTimeFormat string
+ now time.Time
+ parseEmoji bool
+ selectedCommitHash string
+ startIdx int
+ endIdx int
+ showGraph bool
+ bisectInfo *git_commands.BisectInfo
+ showYouAreHereLabel bool
+ expected string
+ focus bool
}{
{
- testName: "no commits",
- commits: []*models.Commit{},
- startIdx: 0,
- endIdx: 1,
- showGraph: false,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
- expected: "",
+ testName: "no commits",
+ commits: []*models.Commit{},
+ startIdx: 0,
+ endIdx: 1,
+ showGraph: false,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ expected: "",
},
{
testName: "some commits",
@@ -61,12 +61,12 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit1", Sha: "sha1"},
{Name: "commit2", Sha: "sha2"},
},
- startIdx: 0,
- endIdx: 2,
- showGraph: false,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ startIdx: 0,
+ endIdx: 2,
+ showGraph: false,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha1 commit1
sha2 commit2
@@ -78,12 +78,12 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit1", Sha: "sha1", Tags: []string{"tag1", "tag2"}},
{Name: "commit2", Sha: "sha2"},
},
- startIdx: 0,
- endIdx: 2,
- showGraph: false,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ startIdx: 0,
+ endIdx: 2,
+ showGraph: false,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha1 tag1 tag2 commit1
sha2 commit2
@@ -103,14 +103,14 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "master", CommitHash: "sha3", Head: false},
{Name: "old-branch", CommitHash: "sha4", Head: false},
},
- currentBranchName: "current-branch",
- hasUpdateRefConfig: true,
- startIdx: 0,
- endIdx: 4,
- showGraph: false,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ currentBranchName: "current-branch",
+ hasUpdateRefConfig: true,
+ startIdx: 0,
+ endIdx: 4,
+ showGraph: false,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha1 commit1
sha2 * commit2
@@ -128,14 +128,14 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "current-branch", CommitHash: "sha1", Head: true},
{Name: "other-branch", CommitHash: "sha1", Head: false},
},
- currentBranchName: "current-branch",
- hasUpdateRefConfig: true,
- startIdx: 0,
- endIdx: 2,
- showGraph: false,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ currentBranchName: "current-branch",
+ hasUpdateRefConfig: true,
+ startIdx: 0,
+ endIdx: 2,
+ showGraph: false,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha1 * commit1
sha2 commit2
@@ -151,14 +151,14 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "current-branch", CommitHash: "sha1", Head: true},
{Name: "other-branch", CommitHash: "sha1", Head: false},
},
- currentBranchName: "current-branch",
- hasUpdateRefConfig: false,
- startIdx: 0,
- endIdx: 2,
- showGraph: false,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ currentBranchName: "current-branch",
+ hasUpdateRefConfig: false,
+ startIdx: 0,
+ endIdx: 2,
+ showGraph: false,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha1 commit1
sha2 commit2
@@ -174,12 +174,12 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
branches: []*models.Branch{
{Name: "some-branch", CommitHash: "sha2"},
},
- startIdx: 0,
- endIdx: 3,
- showGraph: false,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ startIdx: 0,
+ endIdx: 3,
+ showGraph: false,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha1 commit1
sha2 * some-tag commit2
@@ -195,12 +195,12 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}},
{Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}},
},
- startIdx: 0,
- endIdx: 5,
- showGraph: true,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ startIdx: 0,
+ endIdx: 5,
+ showGraph: true,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha1 ⏣─╮ commit1
sha2 ◯ │ commit2
@@ -218,13 +218,13 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}},
{Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}},
},
- startIdx: 0,
- endIdx: 5,
- showGraph: true,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- showYouAreHereLabel: true,
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ startIdx: 0,
+ endIdx: 5,
+ showGraph: true,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ showYouAreHereLabel: true,
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha1 pick commit1
sha2 pick commit2
@@ -242,13 +242,13 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}},
{Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}},
},
- startIdx: 1,
- endIdx: 5,
- showGraph: true,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- showYouAreHereLabel: true,
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ startIdx: 1,
+ endIdx: 5,
+ showGraph: true,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ showYouAreHereLabel: true,
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha2 pick commit2
sha3 ◯ <-- YOU ARE HERE --- commit3
@@ -265,13 +265,13 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}},
{Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}},
},
- startIdx: 3,
- endIdx: 5,
- showGraph: true,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- showYouAreHereLabel: true,
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ startIdx: 3,
+ endIdx: 5,
+ showGraph: true,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ showYouAreHereLabel: true,
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha4 ◯ commit4
sha5 ◯ commit5
@@ -286,13 +286,13 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}},
{Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}},
},
- startIdx: 0,
- endIdx: 2,
- showGraph: true,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- showYouAreHereLabel: true,
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ startIdx: 0,
+ endIdx: 2,
+ showGraph: true,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ showYouAreHereLabel: true,
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha1 pick commit1
sha2 pick commit2
@@ -307,13 +307,13 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}},
{Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}},
},
- startIdx: 4,
- endIdx: 5,
- showGraph: true,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- showYouAreHereLabel: true,
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ startIdx: 4,
+ endIdx: 5,
+ showGraph: true,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ showYouAreHereLabel: true,
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha5 ◯ commit5
`),
@@ -327,13 +327,13 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit4", Sha: "sha4", Parents: []string{"sha5"}, Action: todo.Pick},
{Name: "commit5", Sha: "sha5", Parents: []string{"sha7"}},
},
- startIdx: 0,
- endIdx: 2,
- showGraph: true,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- showYouAreHereLabel: true,
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ startIdx: 0,
+ endIdx: 2,
+ showGraph: true,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ showYouAreHereLabel: true,
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha1 pick commit1
sha2 pick commit2
@@ -346,13 +346,13 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit2", Sha: "sha2", Parents: []string{"sha3"}},
{Name: "commit3", Sha: "sha3", Parents: []string{"sha4"}},
},
- startIdx: 0,
- endIdx: 3,
- showGraph: true,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- showYouAreHereLabel: false,
- now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
+ startIdx: 0,
+ endIdx: 3,
+ showGraph: true,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ showYouAreHereLabel: false,
+ now: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
expected: formatExpected(`
sha1 pick commit1
sha2 ◯ commit2
@@ -365,15 +365,15 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
{Name: "commit1", Sha: "sha1", UnixTimestamp: 1577844184, AuthorName: "Jesse Duffield"},
{Name: "commit2", Sha: "sha2", UnixTimestamp: 1576844184, AuthorName: "Jesse Duffield"},
},
- fullDescription: true,
- timeFormat: "2006-01-02",
- shortTimeFormat: "3:04PM",
- startIdx: 0,
- endIdx: 2,
- showGraph: false,
- bisectInfo: git_commands.NewNullBisectInfo(),
- cherryPickedCommitShaSet: set.New[string](),
- now: time.Date(2020, 1, 1, 5, 3, 4, 0, time.UTC),
+ fullDescription: true,
+ timeFormat: "2006-01-02",
+ shortTimeFormat: "3:04PM",
+ startIdx: 0,
+ endIdx: 2,
+ showGraph: false,
+ bisectInfo: git_commands.NewNullBisectInfo(),
+ cherryPickedCommitHashSet: set.New[string](),
+ now: time.Date(2020, 1, 1, 5, 3, 4, 0, time.UTC),
expected: formatExpected(`
sha1 2:03AM Jesse Duffield commit1
sha2 2019-12-20 Jesse Duffield commit2
@@ -406,14 +406,14 @@ func TestGetCommitListDisplayStrings(t *testing.T) {
s.currentBranchName,
s.hasUpdateRefConfig,
s.fullDescription,
- s.cherryPickedCommitShaSet,
+ s.cherryPickedCommitHashSet,
s.diffName,
s.markedBaseCommit,
s.timeFormat,
s.shortTimeFormat,
s.now,
s.parseEmoji,
- s.selectedCommitSha,
+ s.selectedCommitHash,
s.startIdx,
s.endIdx,
s.showGraph,
diff --git a/pkg/gui/presentation/graph/graph.go b/pkg/gui/presentation/graph/graph.go
index 51a55acea..21530ac6b 100644
--- a/pkg/gui/presentation/graph/graph.go
+++ b/pkg/gui/presentation/graph/graph.go
@@ -32,7 +32,7 @@ type Pipe struct {
var highlightStyle = style.FgLightWhite.SetBold()
-func ContainsCommitSha(pipes []*Pipe, sha string) bool {
+func ContainsCommitHash(pipes []*Pipe, sha string) bool {
for _, pipe := range pipes {
if equalHashes(pipe.fromSha, sha) {
return true
@@ -49,13 +49,13 @@ func (self Pipe) right() int {
return max(self.fromPos, self.toPos)
}
-func RenderCommitGraph(commits []*models.Commit, selectedCommitSha string, getStyle func(c *models.Commit) style.TextStyle) []string {
+func RenderCommitGraph(commits []*models.Commit, selectedCommitHash string, getStyle func(c *models.Commit) style.TextStyle) []string {
pipeSets := GetPipeSets(commits, getStyle)
if len(pipeSets) == 0 {
return nil
}
- lines := RenderAux(pipeSets, commits, selectedCommitSha)
+ lines := RenderAux(pipeSets, commits, selectedCommitHash)
return lines
}
@@ -73,7 +73,7 @@ func GetPipeSets(commits []*models.Commit, getStyle func(c *models.Commit) style
})
}
-func RenderAux(pipeSets [][]*Pipe, commits []*models.Commit, selectedCommitSha string) []string {
+func RenderAux(pipeSets [][]*Pipe, commits []*models.Commit, selectedCommitHash string) []string {
maxProcs := runtime.GOMAXPROCS(0)
// splitting up the rendering of the graph into multiple goroutines allows us to render the graph in parallel
@@ -98,7 +98,7 @@ func RenderAux(pipeSets [][]*Pipe, commits []*models.Commit, selectedCommitSha s
if k > 0 {
prevCommit = commits[k-1]
}
- line := renderPipeSet(pipeSet, selectedCommitSha, prevCommit)
+ line := renderPipeSet(pipeSet, selectedCommitHash, prevCommit)
innerLines = append(innerLines, line)
}
chunks[i] = innerLines
@@ -282,7 +282,7 @@ func getNextPipes(prevPipes []*Pipe, commit *models.Commit, getStyle func(c *mod
func renderPipeSet(
pipes []*Pipe,
- selectedCommitSha string,
+ selectedCommitHash string,
prevCommit *models.Commit,
) string {
maxPos := 0
@@ -329,10 +329,10 @@ func renderPipeSet(
// we don't want to highlight two commits if they're contiguous. We only want
// to highlight multiple things if there's an actual visible pipe involved.
highlight := true
- if prevCommit != nil && equalHashes(prevCommit.Sha, selectedCommitSha) {
+ if prevCommit != nil && equalHashes(prevCommit.Sha, selectedCommitHash) {
highlight = false
for _, pipe := range pipes {
- if equalHashes(pipe.fromSha, selectedCommitSha) && (pipe.kind != TERMINATES || pipe.fromPos != pipe.toPos) {
+ if equalHashes(pipe.fromSha, selectedCommitHash) && (pipe.kind != TERMINATES || pipe.fromPos != pipe.toPos) {
highlight = true
}
}
@@ -341,7 +341,7 @@ func renderPipeSet(
// so we have our commit pos again, now it's time to build the cells.
// we'll handle the one that's sourced from our selected commit last so that it can override the other cells.
selectedPipes, nonSelectedPipes := utils.Partition(pipes, func(pipe *Pipe) bool {
- return highlight && equalHashes(pipe.fromSha, selectedCommitSha)
+ return highlight && equalHashes(pipe.fromSha, selectedCommitHash)
})
for _, pipe := range nonSelectedPipes {
@@ -385,7 +385,7 @@ func renderPipeSet(
}
func equalHashes(a, b string) bool {
- // if our selectedCommitSha is an empty string we treat that as meaning there is no selected commit hash
+ // if our selectedCommitHash is an empty string we treat that as meaning there is no selected commit hash
if a == "" || b == "" {
return false
}
diff --git a/pkg/gui/presentation/reflog_commits.go b/pkg/gui/presentation/reflog_commits.go
index cde774e46..e38a01126 100644
--- a/pkg/gui/presentation/reflog_commits.go
+++ b/pkg/gui/presentation/reflog_commits.go
@@ -12,7 +12,7 @@ import (
"github.com/samber/lo"
)
-func GetReflogCommitListDisplayStrings(commits []*models.Commit, fullDescription bool, cherryPickedCommitShaSet *set.Set[string], diffName string, now time.Time, timeFormat string, shortTimeFormat string, parseEmoji bool) [][]string {
+func GetReflogCommitListDisplayStrings(commits []*models.Commit, fullDescription bool, cherryPickedCommitHashSet *set.Set[string], diffName string, now time.Time, timeFormat string, shortTimeFormat string, parseEmoji bool) [][]string {
var displayFunc func(*models.Commit, reflogCommitDisplayAttributes) []string
if fullDescription {
displayFunc = getFullDescriptionDisplayStringsForReflogCommit
@@ -22,7 +22,7 @@ func GetReflogCommitListDisplayStrings(commits []*models.Commit, fullDescription
return lo.Map(commits, func(commit *models.Commit, _ int) []string {
diffed := commit.Sha == diffName
- cherryPicked := cherryPickedCommitShaSet.Includes(commit.Sha)
+ cherryPicked := cherryPickedCommitHashSet.Includes(commit.Sha)
return displayFunc(commit,
reflogCommitDisplayAttributes{
cherryPicked: cherryPicked,