blob: ecd5c9ae8748de0e914b3a0e4ec3c2df3471d579 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package gui
import "github.com/jesseduffield/lazygit/pkg/commands/models"
// this file is to put things where it's not obvious where they belong while this refactor takes place
func (gui *Gui) getSuggestedRemote() string {
remotes := gui.State.Model.Remotes
return getSuggestedRemote(remotes)
}
func getSuggestedRemote(remotes []*models.Remote) string {
if len(remotes) == 0 {
return "origin"
}
for _, remote := range remotes {
if remote.Name == "origin" {
return remote.Name
}
}
return remotes[0].Name
}
|