Add a new remote (generate a path for it to live in, will be cleaned up)
(name string)
| 464 | |
| 465 | // Add a new remote (generate a path for it to live in, will be cleaned up) |
| 466 | func (r *Repo) AddRemote(name string) *Repo { |
| 467 | if _, exists := r.Remotes[name]; exists { |
| 468 | r.callback.Fatalf("Remote %v already exists", name) |
| 469 | } |
| 470 | remote := newRepo(r.callback, &RepoCreateSettings{ |
| 471 | RepoType: RepoTypeBare, |
| 472 | }) |
| 473 | r.Remotes[name] = remote |
| 474 | RunGitCommand(r.callback, true, "remote", "add", name, remote.Path) |
| 475 | return remote |
| 476 | } |
| 477 | |
| 478 | // Just a pseudo-random stream of bytes (not cryptographic) |
| 479 | // Calls RNG a bit less often than using rand.Source directly |