fetchRemoteRef fetch a specific remote ref (branch, tag, or commit).
(nameVersion, repoDir, remoteName, refName string)
| 411 | |
| 412 | // fetchRemoteRef fetch a specific remote ref (branch, tag, or commit). |
| 413 | func 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 | } |
no test coverage detected