ref-filter: simplify return type of match_points_at
commitd9e00621591549cd2d9989d290a7e0c63eadd03b
authorJeff King <peff@peff.net>
Sun, 2 Jul 2023 22:38:29 +0000 (2 18:38 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Jul 2023 21:16:05 +0000 (17 14:16 -0700)
treed9ea5e646ec343e66647188e8697c3eac3e41627
parent870eb53ab20e9ff453e3b89b4927c154c2b7211a
ref-filter: simplify return type of match_points_at

We return the oid that matched, but the sole caller only cares whether
we matched anything at all. This is mostly academic, since there's only
one caller, but the lifetime of the returned pointer is not immediately
clear. Sometimes it points to an oid in a tag struct, which should live
forever. And sometimes to the oid passed in, which only lives as long as
the each_ref_fn callback we're called from.

Simplify this to a boolean return which is more direct and obvious. As a
bonus, this lets us avoid the weird pattern of overwriting our "oid"
parameter in the loop (since we now only refer to the tagged oid one
time, and can just inline the call to get it).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ref-filter.c