1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-10 04:07:18 +02:00

change branch regex to only grab the first remote on each line of branch command

This commit is contained in:
Erik Scrafford 2021-12-22 23:35:29 -08:00 committed by Jesse Duffield
parent d5c1cfda4b
commit 089e3bf4fe

View File

@ -27,7 +27,7 @@ func (c *GitCommand) GetRemotes() ([]*models.Remote, error) {
for i, goGitRemote := range goGitRemotes {
remoteName := goGitRemote.Config().Name
re := regexp.MustCompile(fmt.Sprintf(`%s\/([\S]+)`, remoteName))
re := regexp.MustCompile(fmt.Sprintf(`(?m)^\s*%s\/([\S]+)`, remoteName))
matches := re.FindAllStringSubmatch(remoteBranchesStr, -1)
branches := make([]*models.RemoteBranch, len(matches))
for j, match := range matches {