Skip to content

Commit cc0b5a2

Browse files
committed
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.
1 parent a02f1e8 commit cc0b5a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/commands/git_commands/main_branches.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ func (self *MainBranches) GetMergeBase(refName string) string {
6969
// very rarely, users must quit and restart lazygit to fix it; the latter is
7070
// also not very common, but can totally happen and is not an error.
7171

72-
output, _ := self.cmd.New(
72+
output, _, _ := self.cmd.New(
7373
NewGitCmd("merge-base").Arg(refName).Arg(mainBranches...).
7474
ToArgv(),
75-
).DontLog().RunWithOutput()
76-
return ignoringWarnings(output)
75+
).DontLog().RunWithOutputs()
76+
return strings.TrimSpace(output)
7777
}
7878

7979
func (self *MainBranches) determineMainBranches(configuredMainBranches []string) []string {

0 commit comments

Comments
 (0)