X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-add.sh;h=13fad820d4758a041222a9285719245f6c8bac18;hb=8e1618f9612a78ea09b2a926797c781fe06027c9;hp=f719b4b1a81a386c9cf62efad811005471be0f8c;hpb=90768daaa006516c7ae69ed89d7c2e67243dfac1;p=git.git diff --git a/git-add.sh b/git-add.sh index f719b4b1..13fad820 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 \