MCPcopy Index your code
hub / github.com/augmentable-dev/tickgit / validateDir

Function validateDir

cmd/tickgit/commands/helpers.go:9–22  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

7)
8
9func validateDir(dir string) {
10 if dir == "" {
11 cwd, err := os.Getwd()
12 handleError(err, nil)
13 dir = cwd
14 }
15
16 abs, err := filepath.Abs(filepath.Join(dir, ".git"))
17 handleError(err, nil)
18
19 if _, err := os.Stat(abs); os.IsNotExist(err) {
20 handleError(fmt.Errorf("%s is not a git repository", abs), nil)
21 }
22}

Callers 1

todos.goFile · 0.85

Calls 1

handleErrorFunction · 0.85

Tested by

no test coverage detected