From: Junio C Hamano Date: Thu, 16 Feb 2006 03:42:15 +0000 (-0800) Subject: Merge branch 'jc/add' X-Git-Tag: v1.3.0-rc1~207 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/be97bd1b88003f4a19e2832ee0cc6ac20fcab674?hp=5f906b1c34a174fb6a5eb03f8063859d1a487721 Merge branch 'jc/add' * jc/add: Detect misspelled pathspec to git-add --- diff --git a/git-add.sh b/git-add.sh index f719b4b1a8..13fad820d4 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 \