Merge branch 'maint'
authorJunio C Hamano <junkio@cox.net>
Tue, 6 Mar 2007 07:11:54 +0000 (23:11 -0800)
committerJunio C Hamano <junkio@cox.net>
Tue, 6 Mar 2007 07:11:54 +0000 (23:11 -0800)
* maint:
git-commit: cd to top before showing the final stat

1  2 
git-commit.sh
diff --combined git-commit.sh
index be3677c2049dca4deb35403804d5ea2d72254e7d,cad16a5e868730dd56f79baf711aed138d7cafe1..b8c00b823656f36f6a6f38493b9569831db713b1
@@@ -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