X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-add.sh;h=13fad820d4758a041222a9285719245f6c8bac18;hb=bbe0c9b8d82aa98aad2ae7e6554cc0b9e2836363;hp=f719b4b1a81a386c9cf62efad811005471be0f8c;hpb=b0d3e9baaa16c805ef941e8f26d55fb23f091ef5;p=git.git diff --git a/git-add.sh b/git-add.sh index f719b4b1a..13fad820d 100755 --- a/git-add.sh +++ b/git-add.sh @@ -24,6 +24,17 @@ while : ; do shift done +# Check misspelled pathspec +case "$#" in +0) ;; +*) + git-ls-files --error-unmatch --others --cached -- "$@" >/dev/null || { + echo >&2 "Maybe you misspelled it?" + exit 1 + } + ;; +esac + if test -f "$GIT_DIR/info/exclude" then git-ls-files -z \