FileExists returns true if the given path exists and is a regular file in the repository worktree.
(filename string)
| 20 | // FileExists returns true if the given path exists and is a regular file in the |
| 21 | // repository worktree. |
| 22 | func (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. |