Emacsg: bin/borg-bootstrap: exit on fatal errors

This commit is contained in:
Jonas Bernoulli 2016-12-01 16:08:56 +01:00
parent 19d1fae6ce
commit 8e437d064e

View File

@ -40,6 +40,8 @@ hive_remote=$(git config -f .gitmodules borg.collective)
push_remote=$(git config -f .gitmodules borg.pushDefault) push_remote=$(git config -f .gitmodules borg.pushDefault)
toplevel=$(git rev-parse --show-toplevel) toplevel=$(git rev-parse --show-toplevel)
test -n "$toplevel" || exit 2
cd "$toplevel"
git submodule--helper list | git submodule--helper list |
while read mode sha1 stage path while read mode sha1 stage path
@ -90,11 +92,16 @@ do
if test -e "$path"/.git if test -e "$path"/.git
then then
cd "$path" cd "$path"
git reset --hard "$sha1" || if ! git reset --hard "$sha1"
echo >&2 "futile: checkout of '$sha1' into submodule path '$path' failed" then
echo >&2 "futile: Checkout of '$sha1' into submodule path '$path' failed"
git reset --hard HEAD
exit 1
fi
cd "$toplevel" cd "$toplevel"
else else
echo >&2 "futile: clone of any remote into submodule path '$path' failed" echo >&2 "futile: Clone of any remote into submodule path '$path' failed"
exit 1
fi fi
fi fi
done done