built-in rebase: set ORIG_HEAD just once, before the rebase
commitcbd29ead92d8555f2b918c7f9d53913f26f7a872
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sun, 3 Mar 2019 17:11:55 +0000 (3 09:11 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Mar 2019 04:31:04 +0000 (4 13:31 +0900)
tree1e6d2a159a19144c4e39f6d86427626e9692f1ff
parentc2d96293602bf6e8ffa1002cff8cb6faa3854815
built-in rebase: set ORIG_HEAD just once, before the rebase

Technically, the scripted version set ORIG_HEAD only in two spots (which
really could have been one, because it called `git checkout $onto^0` to
start the rebase and also if it could take a shortcut, and in both cases
it called `git update-ref $orig_head`).

Practically, it *implicitly* reset ORIG_HEAD whenever `git reset --hard`
was called.

However, what we really want is that it is set exactly once, at the
beginning of the rebase.

So let's do that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c
t/t3400-rebase.sh