mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Fix yellow/red coloring while rebasing
It determines the yellow/red status by getting the merge-base between the current branch and its upstream; while we're rebasing, the current branch is HEAD, so it tried to get the merge-base between HEAD and HEAD{u}, which doesn't work. Fix this by passing the name of the checked-out branch separately.
This commit is contained in:
parent
9671f549a1
commit
b1314349d7
4 changed files with 20 additions and 15 deletions
|
@ -302,12 +302,14 @@ func (self *RefreshHelper) refreshCommitsWithLimit() error {
|
|||
self.c.Mutexes().LocalCommitsMutex.Lock()
|
||||
defer self.c.Mutexes().LocalCommitsMutex.Unlock()
|
||||
|
||||
checkedOutBranchName := self.determineCheckedOutBranchName()
|
||||
commits, err := self.c.Git().Loaders.CommitLoader.GetCommits(
|
||||
git_commands.GetCommitsOptions{
|
||||
Limit: self.c.Contexts().LocalCommits.GetLimitCommits(),
|
||||
FilterPath: self.c.Modes().Filtering.GetPath(),
|
||||
IncludeRebaseCommits: true,
|
||||
RefName: self.refForLog(),
|
||||
RefForPushedStatus: checkedOutBranchName,
|
||||
All: self.c.Contexts().LocalCommits.GetShowWholeGitGraph(),
|
||||
},
|
||||
)
|
||||
|
@ -317,7 +319,7 @@ func (self *RefreshHelper) refreshCommitsWithLimit() error {
|
|||
self.c.Model().Commits = commits
|
||||
self.RefreshAuthors(commits)
|
||||
self.c.Model().WorkingTreeStateAtLastCommitRefresh = self.c.Git().Status.WorkingTreeState()
|
||||
self.c.Model().CheckedOutBranch = self.determineCheckedOutBranchName()
|
||||
self.c.Model().CheckedOutBranch = checkedOutBranchName
|
||||
|
||||
return self.c.PostRefreshUpdate(self.c.Contexts().LocalCommits)
|
||||
}
|
||||
|
@ -332,6 +334,7 @@ func (self *RefreshHelper) refreshSubCommitsWithLimit() error {
|
|||
FilterPath: self.c.Modes().Filtering.GetPath(),
|
||||
IncludeRebaseCommits: false,
|
||||
RefName: self.c.Contexts().SubCommits.GetRef().FullRefName(),
|
||||
RefForPushedStatus: self.c.Contexts().SubCommits.GetRef().FullRefName(),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue