]> git.99rst.org Git - git.git/commit
rebase: pass correct arguments to post-checkout hook
authorPhillip Wood <redacted>
Wed, 26 Jan 2022 13:05:38 +0000 (13:05 +0000)
committerJunio C Hamano <redacted>
Wed, 26 Jan 2022 20:08:52 +0000 (12:08 -0800)
commit69f4c23009ee30faeb61a831f4265791c945783e
tree4521a6bcadf828e73d54b9e5f30c1c686a2623d2
parentbd55eee04b698af6c10c77b24f88601814771ac8
rebase: pass correct arguments to post-checkout hook

If a rebase started with "rebase [--apply|--merge] <upstream> <branch>"
detects that <upstream> is an ancestor of <branch> then it fast-forwards
and checks out <branch>. Unfortunately in that case it passed the null
oid as the first argument to the post-checkout hook rather than the oid
of HEAD.

A side effect of this change is that the call to update_ref() which
updates HEAD now always receives the old value of HEAD. This provides
protection against another process updating HEAD during the checkout.

Signed-off-by: Phillip Wood <redacted>
Signed-off-by: Junio C Hamano <redacted>
reset.c
t/t5403-post-checkout-hook.sh
git clone https://git.99rst.org/PROJECT