Code

user-manual.txt: fix a tiny typo.
[git.git] / git-reset.sh
index b9045bc762471b462c3c99a5357b4b30421ea49f..fee6d98d9cba708828c36a2d2a29dbec8662c36b 100755 (executable)
@@ -43,7 +43,7 @@ case "$1" in --) shift ;; esac
 # affecting the working tree nor HEAD.
 if test $# != 0
 then
-       test "$reset_type" == "--mixed" ||
+       test "$reset_type" = "--mixed" ||
                die "Cannot do partial $reset_type reset."
 
        git-diff-index --cached $rev -- "$@" |
@@ -53,11 +53,7 @@ then
        exit
 fi
 
-TOP=$(git-rev-parse --show-cdup)
-if test ! -z "$TOP"
-then
-       cd "$TOP"
-fi
+cd_to_toplevel
 
 if test "$reset_type" = "--hard"
 then
@@ -91,7 +87,7 @@ update_ref_status=$?
 case "$reset_type" in
 --hard )
        test $update_ref_status = 0 && {
-               echo -n "HEAD is now at "
+               printf "HEAD is now at "
                GIT_PAGER= git log --max-count=1 --pretty=oneline \
                        --abbrev-commit HEAD
        }