aboutsummaryrefslogtreecommitdiff
path: root/add
diff options
context:
space:
mode:
Diffstat (limited to 'add')
-rwxr-xr-xadd4
1 files changed, 4 insertions, 0 deletions
diff --git a/add b/add
index b99da32..3ff0270 100755
--- a/add
+++ b/add
@@ -38,6 +38,10 @@ modified="$(git status --porcelain | sed -n -e 's/^ M \(.*\)/\1/p')"
uc="$(echo "$untracked" | wc -w)"
mc="$(echo "$modified" | wc -w)"
+if [ "$uc" -eq 0 -a "$mc" -eq 0 ]; then
+ error "error: nothing untracked/modified"
+fi
+
if [ "$uc" -gt 0 -a "$mc" -gt 0 ]; then
error "error: multiple untracked/modified files"
fi