[PATCH] HTTP partial transfer support for object, pack, and index transfers
[git.git] / git-commit.sh
index 741444a..18b259c 100755 (executable)
@@ -94,13 +94,13 @@ esac
 case "$all,$#" in
 t,*)
        git-diff-files --name-only -z |
-       xargs -0 git-update-index -q --remove --
+       git-update-index --remove -z --stdin
        ;;
 ,0)
        ;;
 *)
        git-diff-files --name-only -z "$@" |
-       xargs -0 git-update-index -q --remove --
+       git-update-index --remove -z --stdin
        ;;
 esac || exit 1
 git-update-index -q --refresh || exit 1
@@ -141,6 +141,9 @@ t)
 esac
 
 if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
+
+       test -f "$GIT_DIR/MERGE_MSG" && cat "$GIT_DIR/MERGE_MSG"
+
        echo "#"
        echo "# It looks like your may be committing a MERGE."
        echo "# If this is not correct, please remove the file"
@@ -156,9 +159,11 @@ if [ ! -r "$GIT_DIR/HEAD" ]; then
                exit 1
        fi
        PARENTS=""
+       current=
 else
+       current=$(git-rev-parse --verify HEAD)
        if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
-               PARENTS="-p HEAD -p MERGE_HEAD"
+               PARENTS="-p HEAD "`sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD"`
        fi
        if test "$use_commit" != ""
        then
@@ -217,7 +222,7 @@ if test -s .cmitchk
 then
        tree=$(git-write-tree) &&
        commit=$(cat .cmitmsg | git-commit-tree $tree $PARENTS) &&
-       echo $commit > "$GIT_DIR/HEAD" &&
+       git-update-ref HEAD $commit $current &&
        rm -f -- "$GIT_DIR/MERGE_HEAD"
 else
        echo >&2 "* no commit message?  aborting commit."