-git diff HEAD | cmp --quiet - /dev/zero && is_pristine=true
-[ -n "is_pristine" ] || output="$output-pending"
+changes=$(git diff HEAD | wc -l); changes=$(echo $changes)
+[ "$changes" == 0 ] && is_pristine=true
+[ -n "$is_pristine" ] || output="$output-pending"