From: Michal Sojka Date: Fri, 27 Jul 2018 13:08:08 +0000 (+0200) Subject: Do not fail during initial status when there are no files X-Git-Tag: debian/20180727b~2 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sojka/duhome.git/commitdiff_plain/50762f5c14f92775195e2a39830a151192f01d23?hp=0b3dd2341c4d1d7f7499f4981bb1e4428088cce6 Do not fail during initial status when there are no files --- diff --git a/duhome b/duhome index fce4328..0102e98 100755 --- a/duhome +++ b/duhome @@ -12,7 +12,9 @@ case "$1" in ;; save) cd $DATA - git rm --force --quiet '*' # Remove old data - perhaps, some homes were removed + if [ -n "$(git ls-files)" ]; then + git rm --force --quiet '*' # Remove old data - perhaps, some homes were removed + fi for i in /home/*; do du -shx $i | cut -f1 > ${i#/home/}; git add ${i#/home/}