mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-23 00:39:13 +02:00
support detached heads when showing the selected branch
This commit is contained in:
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user