summaryrefslogtreecommitdiff
path: root/git-reset.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-reset.sh')
-rwxr-xr-xgit-reset.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-reset.sh b/git-reset.sh
index 46451d0d64..5c0224090a 100755
--- a/git-reset.sh
+++ b/git-reset.sh
@@ -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