mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Merge 0a9ca18309 into 8924bca76f
This commit is contained in:
commit
8204549450
|
|
@ -76,7 +76,8 @@ func GetCommitListDisplayStrings(
|
|||
bisectBounds := getbisectBounds(commits, bisectInfo)
|
||||
|
||||
// function expects to be passed the index of the commit in terms of the `commits` slice
|
||||
var getGraphLine func(int) string
|
||||
getGraphLine := func(int) string { return "" }
|
||||
|
||||
if showGraph {
|
||||
if len(commits) > 0 && commits[0].Divergence != models.DivergenceNone {
|
||||
// Showing a divergence log; we know we don't have any rebasing
|
||||
|
|
@ -107,9 +108,9 @@ func GetCommitListDisplayStrings(
|
|||
allGraphLines = append(allGraphLines, graphLines...)
|
||||
}
|
||||
}
|
||||
if localSectionStart < len(commits) {
|
||||
if localSectionStart < len(commits) && localSectionStart < endIdx {
|
||||
// we have some local commits
|
||||
pipeSets := loadPipesets(commits[localSectionStart:])
|
||||
pipeSets := loadPipesets(commits[localSectionStart:endIdx])
|
||||
if localSectionStart < endIdx {
|
||||
// some of the local commits are visible
|
||||
graphOffset := max(startIdx, localSectionStart)
|
||||
|
|
@ -128,12 +129,12 @@ func GetCommitListDisplayStrings(
|
|||
getGraphLine = func(idx int) string {
|
||||
return allGraphLines[idx-startIdx]
|
||||
}
|
||||
} else {
|
||||
} else if rebaseOffset < endIdx {
|
||||
// this is where the graph begins (may be beyond the TODO commits depending on startIdx,
|
||||
// but we'll never include TODO commits as part of the graph because it'll be messy)
|
||||
graphOffset := max(startIdx, rebaseOffset)
|
||||
|
||||
pipeSets := loadPipesets(commits[rebaseOffset:])
|
||||
pipeSets := loadPipesets(commits[rebaseOffset:endIdx])
|
||||
pipeSetOffset := max(startIdx-rebaseOffset, 0)
|
||||
graphPipeSets := pipeSets[pipeSetOffset:max(endIdx-rebaseOffset, 0)]
|
||||
graphCommits := commits[graphOffset:endIdx]
|
||||
|
|
@ -149,8 +150,6 @@ func GetCommitListDisplayStrings(
|
|||
return ""
|
||||
}
|
||||
}
|
||||
} else {
|
||||
getGraphLine = func(int) string { return "" }
|
||||
}
|
||||
|
||||
// Determine the hashes of the local branches for which we want to show a
|
||||
|
|
|
|||
Loading…
Reference in a new issue