From cc0b5a2f7f26c92fe869b174b724fb66dd0931de Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 31 Jul 2025 10:42:46 +0200 Subject: [PATCH] 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. --- pkg/commands/git_commands/main_branches.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/commands/git_commands/main_branches.go b/pkg/commands/git_commands/main_branches.go index 6bfc648db..109f9cfd8 100644 --- a/pkg/commands/git_commands/main_branches.go +++ b/pkg/commands/git_commands/main_branches.go @@ -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 // 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...). ToArgv(), - ).DontLog().RunWithOutput() - return ignoringWarnings(output) + ).DontLog().RunWithOutputs() + return strings.TrimSpace(output) } func (self *MainBranches) determineMainBranches(configuredMainBranches []string) []string {