Fail silently when listing, if the user is not in a git repo
Adds a check for if the current directory is part of a git repository.
This is to prevent a loud failure when trying to build auto-completion options.
Eg. in fish, when typing wt and trying to auto-complete outside a git repo, stderr would get polluted with git complaining and completion would stop working for the rest of the shell session duration.
@mateusauler thank you for the PR, can you post an image of failure you're referring to.
Of course! Here it is:
Also, after some testing, fish stops completing even when the completion script does not fail and simply outputs nothing. I'll investigate further and open another PR if I can fix it.