diff options
author | Junio C Hamano <junkio@cox.net> | 2006-02-15 19:42:15 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-02-15 19:42:15 -0800 |
commit | be97bd1b88003f4a19e2832ee0cc6ac20fcab674 (patch) | |
tree | e5f43fd4de4dd21a71c8a1b7da41658eb653f8e7 | |
parent | 5f906b1c34a174fb6a5eb03f8063859d1a487721 (diff) | |
parent | 45e48120bb591b9ef156026ae7498ebd6a144962 (diff) | |
download | git-be97bd1b88003f4a19e2832ee0cc6ac20fcab674.tar.gz |
Merge branch 'jc/add'
* jc/add:
Detect misspelled pathspec to git-add
-rwxr-xr-x | git-add.sh | 11 |
1 files changed, 11 insertions, 0 deletions
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 \ |