use file_exists() to check if a file exists in the worktree