summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bc483d0)
raw | patch | inline | side by side (parent: bc483d0)
author | Junio C Hamano <junkio@cox.net> | |
Thu, 6 Jul 2006 02:44:03 +0000 (19:44 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 6 Jul 2006 02:44:03 +0000 (19:44 -0700) |
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>
"--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>
git-reset.sh | patch | blob | history |
diff --git a/git-reset.sh b/git-reset.sh
index 46451d0d64bdff2c0061d100c8d3b3bd38c21454..5c0224090a252bed3258bbbb127e84e61a874197 100755 (executable)
--- a/git-reset.sh
+++ b/git-reset.sh
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