Code

rebase-i-p: use HEAD for updating the ref instead of mapping OLDHEAD
authorStephen Haberman <stephen@exigencecorp.com>
Wed, 15 Oct 2008 07:44:35 +0000 (02:44 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Oct 2008 16:23:53 +0000 (09:23 -0700)
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>
git-rebase--interactive.sh

index 30e45237a2d9c126d9d3dd29737a09cb2de290a1..c9681178f7e65ca2c6ed62dc24347f2dbdbab429 100755 (executable)
@@ -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)" &&