(url string, push bool)
| 489 | } |
| 490 | |
| 491 | func MapRemoteURL(url string, push bool) (string, bool) { |
| 492 | urls, err := RemoteURLs(push) |
| 493 | if err != nil { |
| 494 | return url, false |
| 495 | } |
| 496 | |
| 497 | for name, remotes := range urls { |
| 498 | if len(remotes) == 1 && url == remotes[0] { |
| 499 | return name, true |
| 500 | } |
| 501 | } |
| 502 | return url, false |
| 503 | } |
| 504 | |
| 505 | // Refs returns all of the local and remote branches and tags for the current |
| 506 | // repository. Other refs (HEAD, refs/stash, git notes) are ignored. |