MCPcopy Create free account
hub / github.com/belak/gitdir / DirExists

Method DirExists

internal/git/operations.go:33–40  ·  view source on GitHub ↗

DirExists returns true if the given path exists and is a directory in the repository worktree.

(filename string)

Source from the content-addressed store, hash-verified

31// DirExists returns true if the given path exists and is a directory in the
32// repository worktree.
33func (r *Repository) DirExists(filename string) bool {
34 stat, err := r.WorktreeFS.Stat(filename)
35 if err != nil {
36 return false
37 }
38
39 return stat.Mode().IsDir()
40}
41
42// CreateFile is a convenience method to set the contents of a file in the
43// repo and stage it.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected