From 089e3bf4feab523794d84b9b4051b4d8a3de1e2d Mon Sep 17 00:00:00 2001 From: Erik Scrafford Date: Wed, 22 Dec 2021 23:35:29 -0800 Subject: change branch regex to only grab the first remote on each line of branch command --- pkg/commands/loading_remotes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/commands') diff --git a/pkg/commands/loading_remotes.go b/pkg/commands/loading_remotes.go index 49d4fabfe..096deb71c 100644 --- a/pkg/commands/loading_remotes.go +++ b/pkg/commands/loading_remotes.go @@ -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 { -- cgit v1.2.3