MCPcopy
hub / github.com/git-lfs/git-lfs / AddRemote

Method AddRemote

t/cmd/util/testutils.go:466–476  ·  view source on GitHub ↗

Add a new remote (generate a path for it to live in, will be cleaned up)

(name string)

Source from the content-addressed store, hash-verified

464
465// Add a new remote (generate a path for it to live in, will be cleaned up)
466func (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

Callers 3

TestScanUnpushedFunction · 0.95
TestRecentBranchesFunction · 0.95

Calls 3

newRepoFunction · 0.85
RunGitCommandFunction · 0.85
FatalfMethod · 0.65

Tested by 3

TestScanUnpushedFunction · 0.76
TestRecentBranchesFunction · 0.76