MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / IsGitRepo

Function IsGitRepo

internal/git/git.go:46–50  ·  view source on GitHub ↗

IsGitRepo returns true if the directory is inside a git repository.

(dir string)

Source from the content-addressed store, hash-verified

44
45// IsGitRepo returns true if the directory is inside a git repository.
46func IsGitRepo(dir string) bool {
47 cmd := exec.Command("git", "rev-parse", "--git-dir")
48 cmd.Dir = dir
49 return cmd.Run() == nil
50}
51
52// CommitCount returns the number of commits on branch that are not on the default branch.
53// Returns 0 if the count cannot be determined.

Callers 3

NewAppWithOptionsFunction · 0.92
startLoopForPRDMethod · 0.92
runTUIWithOptionsFunction · 0.92

Calls 1

RunMethod · 0.80

Tested by

no test coverage detected