diff options
author | Erik Scrafford <erik.scrafford@gmail.com> | 2021-12-22 23:35:29 -0800 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-12-23 19:30:47 +1100 |
commit | 089e3bf4feab523794d84b9b4051b4d8a3de1e2d (patch) | |
tree | 8cad0024164ea3fc4835ad3a07ae0b01583719f2 /pkg | |
parent | d5c1cfda4b35421b1db9523bb157676d82cf878e (diff) |
change branch regex to only grab the first remote on each line of branch command
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/commands/loading_remotes.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |