Update git status to use porcelain

pyenv-update was failing for me with the following errors, even though I had no local changes:

$ pyenv update
Updating /home/vagrant/.pyenv...
pyenv-update: /home/vagrant/.pyenv is not clean
Updating /home/vagrant/.pyenv/plugins/pyenv-doctor...
pyenv-update: /home/vagrant/.pyenv/plugins/pyenv-doctor is not clean
Updating /home/vagrant/.pyenv/plugins/pyenv-pip-rehash...
pyenv-update: /home/vagrant/.pyenv/plugins/pyenv-pip-rehash is not clean
Updating /home/vagrant/.pyenv/plugins/pyenv-update...
pyenv-update: /home/vagrant/.pyenv/plugins/pyenv-update is not clean
Updating /home/vagrant/.pyenv/plugins/pyenv-virtualenvwrapper...
pyenv-update: /home/vagrant/.pyenv/plugins/pyenv-virtualenvwrapper is not clean
Updating /home/vagrant/.pyenv/plugins/pyenv-which-ext...
pyenv-update: /home/vagrant/.pyenv/plugins/pyenv-which-ext is not clean

I've updated the script to use --porcelain instead of --short.
From the man page:
"       --porcelain
           Give the output in an easy-to-parse format for scripts. This is similar to the short output, but will remain
           stable across Git versions and regardless of user configuration. See below for details."
This commit is contained in:
jimmywan
2015-05-06 12:00:10 -05:00
parent 1da322f6db
commit f3d33dabbe

View File

@@ -20,7 +20,7 @@ verify_repo_branch() {
}
verify_repo_clean() {
! ( cd "$1" && git status --short ) | grep -q -v '^[!?][!?]'
! ( cd "$1" && git status --porcelain ) | grep -q -v '^[!?][!?]'
}
verify_repo() {