2019-11-13 14:18:29 +02:00
|
|
|
package commands
|
|
|
|
|
2019-11-17 03:02:39 +02:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/fatih/color"
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/utils"
|
|
|
|
)
|
|
|
|
|
2019-11-13 14:18:29 +02:00
|
|
|
// Remote : A git remote
|
|
|
|
type Remote struct {
|
|
|
|
Name string
|
|
|
|
Urls []string
|
|
|
|
Selected bool
|
2019-11-17 01:23:06 +02:00
|
|
|
Branches []*RemoteBranch
|
2019-11-13 14:18:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetDisplayStrings returns the display string of a remote
|
|
|
|
func (r *Remote) GetDisplayStrings(isFocused bool) []string {
|
|
|
|
|
2019-11-17 03:02:39 +02:00
|
|
|
branchCount := len(r.Branches)
|
|
|
|
|
|
|
|
return []string{r.Name, utils.ColoredString(fmt.Sprintf("%d branches", branchCount), color.FgBlue)}
|
2019-11-13 14:18:29 +02:00
|
|
|
}
|