You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: commit_loader.go
    path of file: ./repos/lazygit/pkg/commands/git_commands
    
    the code of the file until where you have to start completion: package git_commands

import (
	"bytes"
	"fmt"
	"os"
	"path/filepath"
	"regexp"
	"sort"
	"strconv"
	"strings"
	"sync"

	"github.com/fsmiamoto/git-todo-p
    
func (self *CommitLoader) getMergeBase(refName string) string {
	if self.mainBranches == nil {
		self.mainBranches = self.getExistingMainBranches()
	}

	if len(self.mainBranches) == 0 {
		return ""
	}

	// We pass all configured main branches to the merge-base call; git will
	// return the base commit for the closest one.

	output, err := self.cmd.New(
		NewGitCmd("merge-base").Arg(refName).Arg(self.mainBranches...).
			ToArgv(),
	).DontLog().RunWithOutput()
	if err != nil {
		// If there's an error, it must be because one of the main branches that
		// used to exist when we called getExistingMainBranches() was deleted
		// meanwhile. To fix this for next time, throw away our cache.
		self.mainBranches = nil
	}
	return ignoringWarnings(output)
}