]> git.ipfire.org Git - thirdparty/git.git/commit
reflog expire: refactor & use "tip_commit" only for UE_NORMAL
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 22 Dec 2021 04:06:44 +0000 (05:06 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Dec 2021 00:24:13 +0000 (16:24 -0800)
commit07815e2d97aa177780ea0d67069b5abd0524f936
tree4b89f69f8a8c77235dc4358c267badd30ebb506d
parent20d6b6868c1446d548094a0a8aa4393a9c58447c
reflog expire: refactor & use "tip_commit" only for UE_NORMAL

Add an intermediate variable for "tip_commit" in
reflog_expiry_prepare(), and only add it to the struct if we're
handling the UE_NORMAL case.

The code behaves the same way as before, but this makes the control
flow clearer, and the shorter name allows us to fold a 4-line i/else
into a one-line ternary instead.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/reflog.c