X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-applypatch.sh;h=9f5a45bb2bbb330207ea4410a76f5521bdc7b850;hb=37f15d50c93398eac90370cfe07315905501bdad;hp=fd594ed4e48a1aee7f4e9c0a6bbb3a44f1bb2120;hpb=215a7ad1ef790467a4cd3f0dcffbd6e5f04c38f7;p=git.git diff --git a/git-applypatch.sh b/git-applypatch.sh index fd594ed4..9f5a45bb 100755 --- a/git-applypatch.sh +++ b/git-applypatch.sh @@ -108,9 +108,10 @@ fi tree=$(git-write-tree) || exit 1 echo Wrote tree $tree -commit=$(git-commit-tree $tree -p $(cat "$GIT_DIR"/HEAD) < "$final") || exit 1 +parent=$(git-rev-parse --verify HEAD) && +commit=$(git-commit-tree $tree -p $parent <"$final") || exit 1 echo Committed: $commit -echo $commit > "$GIT_DIR"/HEAD +git-update-ref HEAD $commit $parent || exit if test -x "$GIT_DIR"/hooks/post-applypatch then