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 | Merge fixes up to 1.2.1 (diff) | |
| parent | Detect misspelled pathspec to git-add (diff) | |
| download | git-be97bd1b88003f4a19e2832ee0cc6ac20fcab674.tar.gz git-be97bd1b88003f4a19e2832ee0cc6ac20fcab674.zip | |
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 \ |
