scripts: cleanup git tree only when one exists

This commit is contained in:
Simon Fels 2017-04-27 06:44:50 +02:00
commit 73ecb78bc6

View file

@ -44,8 +44,10 @@ cleanup() {
# In cases where anbox comes directly from a checked out Android
# build environment we miss some symlinks which are present on
# the host and don't have a valid git repository in that case.
git clean -fdx . || true
git reset --hard || true
if [ -d .git ] ; then
git clean -fdx .
git reset --hard
fi
}
cleanup