agnoster-zsh-theme icon indicating copy to clipboard operation
agnoster-zsh-theme copied to clipboard

Update git prompt to not give error messages

Open Utsav2 opened this issue 7 years ago • 1 comments

The prompt outputs

fatal: This operation must be run in a work tree

Inside the .git folder. This suppresses output of this command.

Utsav2 avatar Mar 23 '17 12:03 Utsav2

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.

belak avatar Nov 24 '17 18:11 belak