Skip to content

Commit

Permalink
Merge branch 'jc/add'
Browse files Browse the repository at this point in the history
* jc/add:
  Detect misspelled pathspec to git-add
  • Loading branch information
Junio C Hamano committed Feb 16, 2006
2 parents 5f906b1 + 45e4812 commit be97bd1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions git-add.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit be97bd1

Please sign in to comment.