diff --git a/git-rebase.sh b/git-rebase.sh
index 49c8f12e51153f5c7ecbdc5a1778c24ba28f428f..fa95009091525eb9ea65bce1e08f293dfd1eddca 100755 (executable)
--- a/git-rebase.sh
+++ b/git-rebase.sh
die "Your working tree does not match $ours_symbolic."
git-read-tree -m -u $ours $upstream &&
-git-rev-parse --verify "$upstream^0" >"$GIT_DIR/HEAD" || exit
+new_head=$(git-rev-parse --verify "$upstream^0") &&
+git-update-ref HEAD "$new_head" || exit
tmp=.rebase-tmp$$
fail=$tmp-fail
continue ;;
esac
echo >&2 "* Applying: $msg"
- S=`cat "$GIT_DIR/HEAD"` &&
+ S=$(git-rev-parse --verify HEAD) &&
git-cherry-pick --replay $commit || {
echo >&2 "* Not applying the patch and continuing."
echo $commit >>$fail