summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-16 03:42:15 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-16 03:42:15 (GMT)
commitbe97bd1b88003f4a19e2832ee0cc6ac20fcab674 (patch)
treee5f43fd4de4dd21a71c8a1b7da41658eb653f8e7
parent5f906b1c34a174fb6a5eb03f8063859d1a487721 (diff)
parent45e48120bb591b9ef156026ae7498ebd6a144962 (diff)
downloadgit-be97bd1b88003f4a19e2832ee0cc6ac20fcab674.zip
git-be97bd1b88003f4a19e2832ee0cc6ac20fcab674.tar.gz
git-be97bd1b88003f4a19e2832ee0cc6ac20fcab674.tar.bz2
Merge branch 'jc/add'
* jc/add: Detect misspelled pathspec to git-add
-rwxr-xr-xgit-add.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/git-add.sh b/git-add.sh
index f719b4b..13fad82 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 \