Use git ls-files when possible.