| 263 | } |
| 264 | |
| 265 | func (c *Configuration) PushRemote() string { |
| 266 | ref := c.CurrentRef() |
| 267 | c.loading.Lock() |
| 268 | defer c.loading.Unlock() |
| 269 | |
| 270 | if c.pushRemote == nil { |
| 271 | if remote, ok := c.Git.Get(fmt.Sprintf("branch.%s.pushRemote", ref.Name)); ok { |
| 272 | c.pushRemote = &remote |
| 273 | } else if remote, ok := c.Git.Get("remote.lfspushdefault"); ok { |
| 274 | c.pushRemote = &remote |
| 275 | } else if remote, ok := c.Git.Get("remote.pushDefault"); ok { |
| 276 | c.pushRemote = &remote |
| 277 | } else { |
| 278 | c.loading.Unlock() |
| 279 | remote := c.Remote() |
| 280 | c.loading.Lock() |
| 281 | |
| 282 | c.pushRemote = &remote |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | return *c.pushRemote |
| 287 | } |
| 288 | |
| 289 | func (c *Configuration) SetValidRemote(name string) error { |
| 290 | if err := git.ValidateRemote(name); err != nil { |