Files
git/builtin
Jeff King db629c61f0 ref-filter: add ref_format_clear() function
After using the ref-filter API, callers should use ref_filter_clear() to
free any used memory. However, there's not a matching function to clear
the ref_format struct.

Traditionally this did not need to be cleaned up, as it was just a way
for the caller to store and pass format options as a single unit. Even
though the parsing step of some placeholders may allocate data, that's
usually inside their "used_atom" structs, which are part of the
ref_filter itself.

But a few placeholders keep data outside of there. The %(ahead-behind)
and %(is-base) parsers both keep a master list of bases, because they
perform a single filtering pass outside of the use of any particular
atom. And since the format parser does not have access to the ref_filter
struct, they store their cross-atom data in the ref_format struct
itself.

And thus when they are finished, the ref_format also needs to be cleaned
up. So let's add a function to do so, and call it from all of the users
of the ref-filter API.

The %(is-base) case is found by running LSan on t6300. After this patch,
the script can now be marked leak-free.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-09 16:26:11 -07:00
..
2024-05-21 09:07:48 -07:00
2024-08-09 08:47:34 -07:00
2024-07-08 14:53:10 -07:00
2024-09-03 09:15:00 -07:00
2024-04-18 12:30:42 -07:00
2024-04-18 12:30:42 -07:00
2024-04-18 12:30:42 -07:00
2024-02-13 10:18:50 -08:00
2024-09-03 09:15:04 -07:00
2024-07-08 14:53:10 -07:00
2024-09-06 10:38:52 -07:00
2023-07-06 11:54:48 -07:00
2024-04-18 12:30:42 -07:00
2024-05-30 08:55:29 -07:00
2024-08-14 14:54:53 -07:00
2024-07-02 09:59:00 -07:00
2024-04-18 12:30:42 -07:00
2024-05-17 10:33:39 -07:00
2024-08-08 09:36:53 -07:00
2024-08-09 08:47:34 -07:00
2024-08-14 14:54:47 -07:00
2024-04-29 20:42:30 +02:00
2024-04-18 12:30:42 -07:00