diff options
Diffstat (limited to 'pkg/commands')
-rw-r--r-- | pkg/commands/git.go | 24 | ||||
-rw-r--r-- | pkg/commands/remote.go | 1 |
2 files changed, 23 insertions, 2 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 40e4bccf7..55f8dddb9 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -1068,12 +1068,32 @@ func (c *GitCommand) GetRemotes() ([]*Remote, error) { return nil, err } + return nil, nil + remotes := make([]*Remote, len(goGitRemotes)) + // TODO: consider including the goGitRemote itself for i, goGitRemote := range goGitRemotes { + goGitBranches, err := goGitRemote.List(&gogit.ListOptions{}) + if err != nil { + c.Log.Warn(err) + continue + } + + branches := []*Branch{} + for _, goGitBranch := range goGitBranches { + // for now we're only getting branch references, not tags/notes/etc + if goGitBranch.Name().IsBranch() { + branches = append(branches, &Branch{ + Name: goGitBranch.Name().String(), + }) + } + } + remotes[i] = &Remote{ - Name: goGitRemote.Config().Name, - Urls: goGitRemote.Config().URLs, + Name: goGitRemote.Config().Name, + Urls: goGitRemote.Config().URLs, + Branches: branches, } } return remotes, nil diff --git a/pkg/commands/remote.go b/pkg/commands/remote.go index 7e9e5f6f8..8f2941505 100644 --- a/pkg/commands/remote.go +++ b/pkg/commands/remote.go @@ -5,6 +5,7 @@ type Remote struct { Name string Urls []string Selected bool + Branches []*Branch } // GetDisplayStrings returns the display string of a remote |