MCPcopy Create free account
hub / github.com/celer-pkg/celer / fetchRemoteRef

Function fetchRemoteRef

pkgs/git/local.go:413–422  ·  view source on GitHub ↗

fetchRemoteRef fetch a specific remote ref (branch, tag, or commit).

(nameVersion, repoDir, remoteName, refName string)

Source from the content-addressed store, hash-verified

411
412// fetchRemoteRef fetch a specific remote ref (branch, tag, or commit).
413func fetchRemoteRef(nameVersion, repoDir, remoteName, refName string) error {
414 title := fmt.Sprintf("[git fetch remote ref: %s]", nameVersion)
415 executor := cmd.NewExecutor(title, "git", "fetch", remoteName, refName)
416 executor.SetWorkDir(repoDir)
417 if output, err := executor.ExecuteOutput(); err != nil {
418 return fmt.Errorf("failed to git fetch remote ref %s for %s: %s -> %w", refName, nameVersion, output, err)
419 }
420
421 return nil
422}

Callers 2

CheckIfRefMatchesFunction · 0.85
RevParseRepoRefFunction · 0.85

Calls 4

NewExecutorFunction · 0.92
SprintfMethod · 0.80
SetWorkDirMethod · 0.80
ExecuteOutputMethod · 0.80

Tested by

no test coverage detected