1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 22:33:07 +02:00

Cleanup: remove the ignoringWarnings hack from GetMergeBase

GetMergeBase is always called with a full ref, so it shouldn't need the
ignoringWarnings hack (which is about ignoring warnings coming from ambiguous
refs).

Also, separate stdout and stderr, which would also have solved the problem. We
no longer really need it now, but it's still cleaner.
This commit is contained in:
Stefan Haller
2025-07-31 10:42:46 +02:00
parent a02f1e8655
commit cc0b5a2f7f

View File

@ -69,11 +69,11 @@ func (self *MainBranches) GetMergeBase(refName string) string {
// very rarely, users must quit and restart lazygit to fix it; the latter is // very rarely, users must quit and restart lazygit to fix it; the latter is
// also not very common, but can totally happen and is not an error. // also not very common, but can totally happen and is not an error.
output, _ := self.cmd.New( output, _, _ := self.cmd.New(
NewGitCmd("merge-base").Arg(refName).Arg(mainBranches...). NewGitCmd("merge-base").Arg(refName).Arg(mainBranches...).
ToArgv(), ToArgv(),
).DontLog().RunWithOutput() ).DontLog().RunWithOutputs()
return ignoringWarnings(output) return strings.TrimSpace(output)
} }
func (self *MainBranches) determineMainBranches(configuredMainBranches []string) []string { func (self *MainBranches) determineMainBranches(configuredMainBranches []string) []string {