checkout: avoid using the rev_info flag leak_pending
commita9a03fa0d7292758b1c5038c0acb9466c9ac36da
authorRené Scharfe <l.s.r@web.de>
Mon, 25 Dec 2017 17:47:04 +0000 (25 18:47 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Dec 2017 21:50:05 +0000 (28 13:50 -0800)
tree50f979b0839ff97b3109d5b2d31b9f7617147c13
parent63647391e6c306363dcb61d160c84cc601912efb
checkout: avoid using the rev_info flag leak_pending

The leak_pending flag is so awkward to use that multiple comments had to
be added around each occurrence.  We only use it for remembering the
commits whose marks we have to clear after checking if the old HEAD is
detached.  This is easy, though: We need to do that for the old commit,
the new one -- and for all refs.

Don't bother tracking exactly which commits need their flags cleared,
just nuke all we have in-core.  This change is safe because refs can
point at anything, so other program parts can't depend on any kept flags
anyway.  And since all refs are loaded we have to basically deal with
all commits anyway, so performance should not be negatively impacted.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/checkout.c