Use `git ls-files` anywhere in a git repository

Check the existstatus of a git command to properly decide if you're in
git or not.