X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-commit.sh;h=18b259c7086224f70cfd69798dc6332df040a61d;hb=37f15d50c93398eac90370cfe07315905501bdad;hp=9412840d8f2cc58b19d2ae3406396f2a271135d4;hpb=07cdbb35ccc5dc9d9a6ef34faa8998b8221d73ee;p=git.git diff --git a/git-commit.sh b/git-commit.sh index 9412840d..18b259c7 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -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 @@ -159,7 +159,9 @@ 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 "`sed -e 's/^/-p /' "$GIT_DIR/MERGE_HEAD"` fi @@ -220,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."