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

Function ValidateRemoteFromList

git/git.go:580–592  ·  view source on GitHub ↗

ValidateRemote checks that a named remote is valid for use given a list from RemoteList. This is completely identical to ValidateRemote, except that it allows caching the remote list.

(remotes []string, remote string)

Source from the content-addressed store, hash-verified

578// RemoteList. This is completely identical to ValidateRemote, except that it
579// allows caching the remote list.
580func ValidateRemoteFromList(remotes []string, remote string) error {
581 for _, r := range remotes {
582 if r == remote {
583 return nil
584 }
585 }
586
587 if err := ValidateRemoteURL(remote); err == nil {
588 return nil
589 }
590
591 return errors.New(tr.Tr.Get("invalid remote name: %q", remote))
592}
593
594// ValidateRemoteURL checks that a string is a valid Git remote URL
595func ValidateRemoteURL(remote string) error {

Callers 2

GitRemoteURLMethod · 0.92
ValidateRemoteFunction · 0.85

Calls 3

NewFunction · 0.92
ValidateRemoteURLFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected