rebase-i-p: use HEAD for updating the ref instead of mapping OLDHEAD

If OLDHEAD was reordered in the todo, and its mapped NEWHEAD was used to set the
ref, commits reordered after OLDHEAD in the todo would should up as un-committed
changes.

Signed-off-by: Stephen Haberman <stephen@exigencecorp.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stephen Haberman 2008-10-15 02:44:35 -05:00 коммит произвёл Junio C Hamano
Родитель 42f939e473
Коммит 72583e6c68
1 изменённых файлов: 1 добавлений и 14 удалений

Просмотреть файл

@ -376,20 +376,7 @@ do_next () {
HEADNAME=$(cat "$DOTEST"/head-name) &&
OLDHEAD=$(cat "$DOTEST"/head) &&
SHORTONTO=$(git rev-parse --short $(cat "$DOTEST"/onto)) &&
if test -d "$REWRITTEN"
then
test -f "$DOTEST"/current-commit &&
current_commit=$(cat "$DOTEST"/current-commit) &&
git rev-parse HEAD > "$REWRITTEN"/$current_commit
if test -f "$REWRITTEN"/$OLDHEAD
then
NEWHEAD=$(cat "$REWRITTEN"/$OLDHEAD)
else
NEWHEAD=$OLDHEAD
fi
else
NEWHEAD=$(git rev-parse HEAD)
fi &&
NEWHEAD=$(git rev-parse HEAD) &&
case $HEADNAME in
refs/*)
message="$GIT_REFLOG_ACTION: $HEADNAME onto $SHORTONTO)" &&