Protection against loss of uncommitted stuff

This commit is contained in:
Laurent Rineau 2017-09-15 17:10:56 +02:00
parent f7bdc97380
commit 7fb5d8dc05
1 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,11 @@
zmodload zsh/stat
set -e
if ! ${git} diff --exit-code > /dev/null || ! ${git} diff --staged --exit-code > /dev/null ; then
echo 'Your working directory contains local modifications!' >&2
exit 1
fi
base=${1:-HEAD}
save=$(git rev-parse HEAD)