git-reset: complain and exit upon seeing an unknown parameter.

The check to use "rev-parse --verify" was defeated by the use of
"--default HEAD".  "git reset --hard bogus-committish" just
defaulted to reset to the HEAD without complaining.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2006-07-05 19:44:03 -07:00
parent bc483d0480
commit ac83aa2e1f

View File

@ -17,7 +17,11 @@ case "$1" in
usage ;;
esac
rev=$(git-rev-parse --verify --default HEAD "$@") || exit
case $# in
0) rev=HEAD ;;
1) rev=$(git-rev-parse --verify "$1") || exit ;;
*) usage ;;
esac
rev=$(git-rev-parse --verify $rev^0) || exit
# We need to remember the set of paths that _could_ be left