MCPcopy Create free account
hub / github.com/git-lfs/git-lfs / RemoteList

Function RemoteList

git/git.go:431–452  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

429}
430
431func RemoteList() ([]string, error) {
432 cmd, err := gitNoLFS("remote")
433 if err != nil {
434 return nil, errors.New(tr.Tr.Get("failed to find `git remote`: %v", err))
435 }
436
437 outp, err := cmd.StdoutPipe()
438 if err != nil {
439 return nil, errors.New(tr.Tr.Get("failed to call `git remote`: %v", err))
440 }
441 cmd.Start()
442 defer cmd.Wait()
443
444 scanner := bufio.NewScanner(outp)
445
446 var ret []string
447 for scanner.Scan() {
448 ret = append(ret, strings.TrimSpace(scanner.Text()))
449 }
450
451 return ret, nil
452}
453
454func RemoteURLs(push bool) (map[string][]string, error) {
455 cmd, err := gitNoLFS("remote", "-v")

Callers 4

getRemoteRefsFunction · 0.92
NewEndpointFinderFunction · 0.92
ValidateRemoteFunction · 0.85
remoteForRefFunction · 0.85

Calls 7

NewFunction · 0.92
gitNoLFSFunction · 0.85
StdoutPipeMethod · 0.80
GetMethod · 0.65
WaitMethod · 0.65
ScanMethod · 0.65
StartMethod · 0.45

Tested by

no test coverage detected