X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-add.sh;h=13fad820d4758a041222a9285719245f6c8bac18;hb=b992933853ccffac85f7e40310167ef7b8f0432e;hp=f719b4b1a81a386c9cf62efad811005471be0f8c;hpb=9a26dbd120110ad4e07d3047abc13d615183c8ec;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 \