name-rev: restructure parsing commits and applying date cutoff
commitdd432a6ecf022b40760dd04fe4e94fdfcb1b270d
authorSZEDER Gábor <szeder.dev@gmail.com>
Tue, 12 Nov 2019 10:38:17 +0000 (12 11:38 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Dec 2019 21:29:04 +0000 (6 13:29 -0800)
tree0c69e0164f8cad94afc38cdcb1e8b75007f88dc2
parentdd090a8a37b4507bf6c79ad93ec076673fa6313c
name-rev: restructure parsing commits and applying date cutoff

At the beginning of the recursive name_rev() function it parses the
commit it got as parameter, and returns early if the commit is older
than a cutoff limit.

Restructure this so the caller parses the commit and checks its date,
and doesn't invoke name_rev() if the commit to be passed as parameter
is older than the cutoff, i.e. both name_ref() before calling
name_rev() and name_rev() itself as it iterates over the parent
commits.

This makes eliminating the recursion a bit easier to follow, and the
condition moved to name_ref() will be moved back to name_rev() after
the recursion is eliminated.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/name-rev.c