MCPcopy Index your code
hub / github.com/belak/gitdir / FileExists

Method FileExists

internal/git/operations.go:22–29  ·  view source on GitHub ↗

FileExists returns true if the given path exists and is a regular file in the repository worktree.

(filename string)

Source from the content-addressed store, hash-verified

20// FileExists returns true if the given path exists and is a regular file in the
21// repository worktree.
22func (r *Repository) FileExists(filename string) bool {
23 stat, err := r.WorktreeFS.Stat(filename)
24 if err != nil {
25 return false
26 }
27
28 return stat.Mode().IsRegular()
29}
30
31// DirExists returns true if the given path exists and is a directory in the
32// repository worktree.

Callers 1

loadUserConfigMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected