From: Junio C Hamano Date: Tue, 6 Mar 2007 07:11:54 +0000 (-0800) Subject: Merge branch 'maint' X-Git-Tag: v1.5.1-rc1~91 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/31930b5beece8ff86f823b62cf0937e73e9494fa?ds=inline;hp=-c Merge branch 'maint' * maint: git-commit: cd to top before showing the final stat --- 31930b5beece8ff86f823b62cf0937e73e9494fa diff --combined git-commit.sh index be3677c204,cad16a5e86..b8c00b8236 --- a/git-commit.sh +++ b/git-commit.sh @@@ -13,10 -13,10 +13,10 @@@ git-rev-parse --verify HEAD >/dev/null case "$0" in *status) status_only=t - unmerged_ok_if_status=--unmerged ;; + ;; *commit) status_only= - unmerged_ok_if_status= ;; + ;; esac refuse_partial () { @@@ -393,17 -393,16 +393,17 @@@ els USE_INDEX="$THIS_INDEX" fi -GIT_INDEX_FILE="$USE_INDEX" \ - git-update-index -q $unmerged_ok_if_status --refresh || exit - -################################################################ -# If the request is status, just show it and exit. - -case "$0" in -*status) +case "$status_only" in +t) + # This will silently fail in a read-only repository, which is + # what we want. + GIT_INDEX_FILE="$USE_INDEX" git-update-index -q --unmerged --refresh run_status exit $? + ;; +'') + GIT_INDEX_FILE="$USE_INDEX" git-update-index -q --refresh || exit + ;; esac ################################################################ @@@ -622,6 -621,9 +622,9 @@@ els fi ret="$?" rm -f "$GIT_DIR/COMMIT_MSG" "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG" + + cd_to_toplevel + if test -d "$GIT_DIR/rr-cache" then git-rerere