mirror of
				https://github.com/jesseduffield/lazygit.git
				synced 2025-10-30 23:57:43 +02:00 
			
		
		
		
	Fix yellow/red coloring of pushed/unpushed commits in branch commits panel (#2448)
This commit is contained in:
		| @@ -401,7 +401,9 @@ func ignoringWarnings(commandOutput string) string { | ||||
| func (self *CommitLoader) getFirstPushedCommit(refName string) (string, error) { | ||||
| 	output, err := self.cmd. | ||||
| 		New( | ||||
| 			fmt.Sprintf("git merge-base %s %s@{u}", self.cmd.Quote(refName), self.cmd.Quote(refName)), | ||||
| 			fmt.Sprintf("git merge-base %s %s@{u}", | ||||
| 				self.cmd.Quote(refName), | ||||
| 				self.cmd.Quote(strings.TrimPrefix(refName, "refs/heads/"))), | ||||
| 		). | ||||
| 		DontLog(). | ||||
| 		RunWithOutput() | ||||
|   | ||||
| @@ -47,6 +47,19 @@ func TestGetCommits(t *testing.T) { | ||||
| 			expectedCommits: []*models.Commit{}, | ||||
| 			expectedError:   nil, | ||||
| 		}, | ||||
| 		{ | ||||
| 			testName:          "should use proper upstream name for branch", | ||||
| 			logOrder:          "topo-order", | ||||
| 			rebaseMode:        enums.REBASE_MODE_NONE, | ||||
| 			currentBranchName: "mybranch", | ||||
| 			opts:              GetCommitsOptions{RefName: "refs/heads/mybranch", IncludeRebaseCommits: false}, | ||||
| 			runner: oscommands.NewFakeRunner(t). | ||||
| 				Expect(`git merge-base "refs/heads/mybranch" "mybranch"@{u}`, "b21997d6b4cbdf84b149d8e6a2c4d06a8e9ec164", nil). | ||||
| 				Expect(`git -c log.showSignature=false log "refs/heads/mybranch" --topo-order --oneline --pretty=format:"%H%x00%at%x00%aN%x00%ae%x00%d%x00%p%x00%s" --abbrev=40`, "", nil), | ||||
|  | ||||
| 			expectedCommits: []*models.Commit{}, | ||||
| 			expectedError:   nil, | ||||
| 		}, | ||||
| 		{ | ||||
| 			testName:          "should return commits if they are present", | ||||
| 			logOrder:          "topo-order", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user