@matheusbsbs / matheus-bagliano / commits / 72583e6c68
Fork 0

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>

Stephen Haberman committed Oct 15, 2008 at 02:44 UTC 72583e6c685a85b9354ee2310cec3d9240df3c0f
1 file changed +1 -14
git-rebase--interactive.sh
+1 -14
@@ -376,20 +376,7 @@ do_next () {
376 HEADNAME=$(cat "$DOTEST"/head-name) &&
377 OLDHEAD=$(cat "$DOTEST"/head) &&
378 SHORTONTO=$(git rev-parse --short $(cat "$DOTEST"/onto)) &&
379 - if test -d "$REWRITTEN"
380 - then
381 - test -f "$DOTEST"/current-commit &&
382 - current_commit=$(cat "$DOTEST"/current-commit) &&
383 - git rev-parse HEAD > "$REWRITTEN"/$current_commit
384 - if test -f "$REWRITTEN"/$OLDHEAD
385 - then
386 - NEWHEAD=$(cat "$REWRITTEN"/$OLDHEAD)
387 - else
388 - NEWHEAD=$OLDHEAD
389 - fi
390 - else
391 - NEWHEAD=$(git rev-parse HEAD)
392 - fi &&
379 + NEWHEAD=$(git rev-parse HEAD) &&
380 case $HEADNAME in
381 refs/*)
382 message="$GIT_REFLOG_ACTION: $HEADNAME onto $SHORTONTO)" &&