MCPcopy Index your code
hub / github.com/nikivdev/go / gitRefExists

Function gitRefExists

cli/flow/main.go:5139–5150  ·  view source on GitHub ↗
(ref string)

Source from the content-addressed store, hash-verified

5137}
5138
5139func gitRefExists(ref string) (bool, error) {
5140 cmd := exec.Command("git", "rev-parse", "--verify", "--quiet", ref)
5141 if err := cmd.Run(); err != nil {
5142 var exitErr *exec.ExitError
5143 if errors.As(err, &exitErr) {
5144 return false, nil
5145 }
5146 return false, err
5147 }
5148
5149 return true, nil
5150}
5151
5152func runGitCommandInDir(ctx *snap.Context, dir string, args ...string) error {
5153 cmd := exec.Command("git", args...)

Callers 6

runBranchFromClipboardFunction · 0.85
runGitSyncForkFunction · 0.85
runGitMirrorPullFunction · 0.85
fetchMirrorBranchFunction · 0.85
runGitCheckoutFunction · 0.85
runGitCheckoutRemoteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected