MCPcopy Index your code
hub / github.com/rilldata/rill / IsGitRepo

Function IsGitRepo

runtime/pkg/gitutil/gitcmdwrapper.go:22–25  ·  view source on GitHub ↗

IsGitRepo reports whether path is inside a git working tree. Returns true for the repo root as well as any subdirectory of it.

(path string)

Source from the content-addressed store, hash-verified

20// IsGitRepo reports whether path is inside a git working tree.
21// Returns true for the repo root as well as any subdirectory of it.
22func IsGitRepo(path string) bool {
23 _, err := Run(context.Background(), path, "rev-parse", "--is-inside-work-tree")
24 return err == nil
25}
26
27func Clone(ctx context.Context, path, remote, checkoutBranch string, singleBranch, shallow bool) error {
28 args := []string{"clone", remote, path}

Callers

nothing calls this directly

Calls 1

RunFunction · 0.70

Tested by

no test coverage detected