builtin-pack-object: cache small deltas
[gitweb.git] / git-commit.sh
index 3656d607d5b91d8d125b5a72b6a2a00aee512618..e8b60f70497c71bd66b96115b9bba78cee523a8c 100755 (executable)
@@ -370,18 +370,18 @@ t,)
                # the same way.
                if test -z "$initial_commit"
                then
-                       cp "$THIS_INDEX" "$TMP_INDEX"
-                       GIT_INDEX_FILE="$TMP_INDEX" git-read-tree -m HEAD
+                       GIT_INDEX_FILE="$THIS_INDEX" \
+                       git-read-tree --index-output="$TMP_INDEX" -i -m HEAD
                else
                        rm -f "$TMP_INDEX"
                fi || exit
 
-               echo "$commit_only" |
+               printf '%s\n' "$commit_only" |
                GIT_INDEX_FILE="$TMP_INDEX" \
                git-update-index --add --remove --stdin &&
 
                save_index &&
-               echo "$commit_only" |
+               printf '%s\n' "$commit_only" |
                (
                        GIT_INDEX_FILE="$NEXT_INDEX"
                        export GIT_INDEX_FILE
@@ -432,7 +432,7 @@ fi
 
 if test "$log_message" != ''
 then
-       echo "$log_message"
+       printf '%s\n' "$log_message"
 elif test "$logfile" != ""
 then
        if test "$logfile" = -
@@ -475,7 +475,7 @@ if test -f "$GIT_DIR/MERGE_HEAD" && test -z "$no_edit"; then
        echo "#"
        echo "# It looks like you may be committing a MERGE."
        echo "# If this is not correct, please remove the file"
-       echo "# $GIT_DIR/MERGE_HEAD"
+       printf '%s\n' "#        $GIT_DIR/MERGE_HEAD"
        echo "# and try again"
        echo "#"
 fi >>"$GIT_DIR"/COMMIT_EDITMSG
@@ -649,8 +649,9 @@ then
        fi
        if test -z "$quiet"
        then
+               commit=`git-diff-tree --always --shortstat --pretty="format:%h: %s"\
+                      --summary --root HEAD --`
                echo "Created${initial_commit:+ initial} commit $commit"
-               git-diff-tree --shortstat --summary --root --no-commit-id HEAD --
        fi
 fi