X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-reset.sh;h=fee6d98d9cba708828c36a2d2a29dbec8662c36b;hb=885b98107547fe3f6d17ca0af0578e040f7600d0;hp=b9045bc762471b462c3c99a5357b4b30421ea49f;hpb=7eff28a9b42cb0d3aad932338b2e645fc6ed8fa9;p=git.git diff --git a/git-reset.sh b/git-reset.sh index b9045bc76..fee6d98d9 100755 --- a/git-reset.sh +++ b/git-reset.sh @@ -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 }