Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail silently when listing, if the user is not in a git repo #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mateusauler
Copy link

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 mateusauler changed the title Fail silently when listing if the user is not in a git repo Fail silently, when listing, if the user is not in a git repo Apr 21, 2024
@mateusauler mateusauler changed the title Fail silently, when listing, if the user is not in a git repo Fail silently when listing, if the user is not in a git repo Apr 24, 2024
@yankeexe
Copy link
Owner

@mateusauler thank you for the PR, can you post an image of failure you're referring to.

@mateusauler
Copy link
Author

mateusauler commented Apr 25, 2024

Of course! Here it is:
image

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants