diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-09-15 03:39:50 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-09-15 03:39:50 +0200 |
commit | 257029ab098eccb41e26d2291ac99ee48f40d058 (patch) | |
tree | 24f25cf3c247148ce3150572b680f5a2680ee99f /add | |
parent | a0ae430f01bb8ab0a98cce2203435a286dd89ff7 (diff) |
Detect no changes situation in add script
Diffstat (limited to 'add')
-rwxr-xr-x | add | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |