starcraftman / zsh-git-prompt

[Active Fork] Informative git prompt for zsh
MIT License
58 stars 15 forks source link

Add check to see if we have a work tree before returning output #41

Open acabal opened 5 years ago

acabal commented 5 years ago

In some bare git repos, or sometimes if entering a repo's .git directory, if there is no work tree the Git prompt becomes corrupted:

screenshot from 2019-01-16 14-02-07

This commit adds a check to gitstatus.py to return early if git status returns fatal: this operation must be run in a work tree.