agnoster-zsh-theme
agnoster-zsh-theme copied to clipboard
Update git prompt to not give error messages
The prompt outputs
fatal: This operation must be run in a work tree
Inside the .git folder. This suppresses output of this command.
This unfortunately breaks the prompt so is_dirty will always be false.
git status --porcelain --ignore-submodules &> /dev/null
will redirect all output (both stdout and stderr) to /dev/null which means that test -n
will always return false.
I assume git status --porcelain --ignore-submodules 2> /dev/null
is what you're looking for.