chiark / gitweb /
Don't git reset if nothing is to be done
authorDaniel Martí <mvdan@mvdan.cc>
Mon, 17 Feb 2014 07:26:29 +0000 (08:26 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Mon, 17 Feb 2014 07:26:29 +0000 (08:26 +0100)
fd-commit

index 4013740c2dc068bf5bf53097928829b596e95e10..4c70cfb1c2150ac2ed6fc11a0024c153e7f79292 100755 (executable)
--- a/fd-commit
+++ b/fd-commit
@@ -100,6 +100,8 @@ while read line; do
        fi
 done < <(git status --porcelain)
 
+[[ -z $commands ]] && exit 0
+
 git reset >/dev/null
 for cmd in "${commands[@]}"; do
        eval "$cmd"