Fix `list_files_git` to work correctly in subdirectories of the main repo

`list_files_git` assumes that the package is at the root of the git repository. This breaks when trying to list files for a package in a subdirectory of a repo, or in other cases, e.g. if the user's home directory is a git repo.
Took me a second to see why this was necessary, could you mention that the outer open was necessary for if the package is itself in a git submodule?