1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 11:02:41 +03:00

Rename showBranchMarkerForHeadCommit parameter to hasRebaseUpdateRefsConfig

Name it after what it is rather than what it is used for. In the next commit we
will use it for another condition.
This commit is contained in:
Stefan Haller
2024-02-24 12:27:27 +01:00
parent fd8ce7d779
commit 418b316fab
3 changed files with 6 additions and 6 deletions

View File

@@ -38,14 +38,14 @@ func NewLocalCommitsContext(c *ContextCommon) *LocalCommitsContext {
} }
showYouAreHereLabel := c.Model().WorkingTreeStateAtLastCommitRefresh == enums.REBASE_MODE_REBASING showYouAreHereLabel := c.Model().WorkingTreeStateAtLastCommitRefresh == enums.REBASE_MODE_REBASING
showBranchMarkerForHeadCommit := c.Git().Config.GetRebaseUpdateRefs() hasRebaseUpdateRefsConfig := c.Git().Config.GetRebaseUpdateRefs()
return presentation.GetCommitListDisplayStrings( return presentation.GetCommitListDisplayStrings(
c.Common, c.Common,
c.Model().Commits, c.Model().Commits,
c.Model().Branches, c.Model().Branches,
c.Model().CheckedOutBranch, c.Model().CheckedOutBranch,
showBranchMarkerForHeadCommit, hasRebaseUpdateRefsConfig,
c.State().GetRepoState().GetScreenMode() != types.SCREEN_NORMAL, c.State().GetRepoState().GetScreenMode() != types.SCREEN_NORMAL,
c.Modes().CherryPicking.SelectedShaSet(), c.Modes().CherryPicking.SelectedShaSet(),
c.Modes().Diffing.Ref, c.Modes().Diffing.Ref,

View File

@@ -55,13 +55,13 @@ func NewSubCommitsContext(
if viewModel.GetShowBranchHeads() { if viewModel.GetShowBranchHeads() {
branches = c.Model().Branches branches = c.Model().Branches
} }
showBranchMarkerForHeadCommit := c.Git().Config.GetRebaseUpdateRefs() hasRebaseUpdateRefsConfig := c.Git().Config.GetRebaseUpdateRefs()
return presentation.GetCommitListDisplayStrings( return presentation.GetCommitListDisplayStrings(
c.Common, c.Common,
c.Model().SubCommits, c.Model().SubCommits,
branches, branches,
viewModel.GetRef().RefName(), viewModel.GetRef().RefName(),
showBranchMarkerForHeadCommit, hasRebaseUpdateRefsConfig,
c.State().GetRepoState().GetScreenMode() != types.SCREEN_NORMAL, c.State().GetRepoState().GetScreenMode() != types.SCREEN_NORMAL,
c.Modes().CherryPicking.SelectedShaSet(), c.Modes().CherryPicking.SelectedShaSet(),
c.Modes().Diffing.Ref, c.Modes().Diffing.Ref,

View File

@@ -41,7 +41,7 @@ func GetCommitListDisplayStrings(
commits []*models.Commit, commits []*models.Commit,
branches []*models.Branch, branches []*models.Branch,
currentBranchName string, currentBranchName string,
showBranchMarkerForHeadCommit bool, hasRebaseUpdateRefsConfig bool,
fullDescription bool, fullDescription bool,
cherryPickedCommitShaSet *set.Set[string], cherryPickedCommitShaSet *set.Set[string],
diffName string, diffName string,
@@ -123,7 +123,7 @@ func GetCommitListDisplayStrings(
!lo.Contains(common.UserConfig.Git.MainBranches, b.Name) && !lo.Contains(common.UserConfig.Git.MainBranches, b.Name) &&
// Don't show a marker for the head commit unless the // Don't show a marker for the head commit unless the
// rebase.updateRefs config is on // rebase.updateRefs config is on
(showBranchMarkerForHeadCommit || b.CommitHash != commits[0].Sha) (hasRebaseUpdateRefsConfig || b.CommitHash != commits[0].Sha)
})) }))
lines := make([][]string, 0, len(filteredCommits)) lines := make([][]string, 0, len(filteredCommits))