summaryrefslogtreecommitdiffstats
path: root/pkg/commands/loading_remotes.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-11-17 12:07:36 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-11-21 22:07:14 +1100
commit55ff0c0dee09b505ecd123f3f893e143651947bf (patch)
treee9df2f62c6ce3e49a80517d65cd07207c7f8edb4 /pkg/commands/loading_remotes.go
parent6b7aaeca45847ebc41aa0fd9b773362d4a79f1ab (diff)
support detached heads when showing the selected branch
Diffstat (limited to 'pkg/commands/loading_remotes.go')
-rw-r--r--pkg/commands/loading_remotes.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/commands/loading_remotes.go b/pkg/commands/loading_remotes.go
index dc5dcac44..c33eb1d37 100644
--- a/pkg/commands/loading_remotes.go
+++ b/pkg/commands/loading_remotes.go
@@ -22,14 +22,15 @@ func (c *GitCommand) GetRemotes() ([]*Remote, error) {
// first step is to get our remotes from go-git
remotes := make([]*Remote, len(goGitRemotes))
for i, goGitRemote := range goGitRemotes {
- name := goGitRemote.Config().Name
+ remoteName := goGitRemote.Config().Name
- re := regexp.MustCompile(fmt.Sprintf("%s\\/(.*)", name))
+ re := regexp.MustCompile(fmt.Sprintf("%s\\/(.*)", remoteName))
matches := re.FindAllStringSubmatch(remoteBranchesStr, -1)
branches := make([]*RemoteBranch, len(matches))
for j, match := range matches {
branches[j] = &RemoteBranch{
- Name: match[1],
+ Name: match[1],
+ RemoteName: remoteName,
}
}