pack-objects: fix handling of multiple --filter options
Since 5cb28270a1
(pack-objects: lazily set up "struct rev_info", don't
leak, 2022-03-28) --filter options given to git pack-objects overrule
earlier ones, letting only the leftmost win and leaking the memory
allocated for earlier ones. Fix that by only initializing the rev_info
struct once.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
f00d811533
commit
825babe5d5
@ -4158,6 +4158,7 @@ static struct list_objects_filter_options *po_filter_revs_init(void *value)
|
|||||||
{
|
{
|
||||||
struct po_filter_data *data = value;
|
struct po_filter_data *data = value;
|
||||||
|
|
||||||
|
if (!data->have_revs)
|
||||||
repo_init_revisions(the_repository, &data->revs, NULL);
|
repo_init_revisions(the_repository, &data->revs, NULL);
|
||||||
data->have_revs = 1;
|
data->have_revs = 1;
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ test_expect_success 'verify normal and blob:limit packfiles have same commits/tr
|
|||||||
test_cmp expected observed
|
test_cmp expected observed
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_failure 'verify small limit and big limit results in small limit' '
|
test_expect_success 'verify small limit and big limit results in small limit' '
|
||||||
git -C r2 ls-files -s large.1000 >ls_files_result &&
|
git -C r2 ls-files -s large.1000 >ls_files_result &&
|
||||||
test_parse_ls_files_stage_oids <ls_files_result |
|
test_parse_ls_files_stage_oids <ls_files_result |
|
||||||
sort >expected &&
|
sort >expected &&
|
||||||
|
Reference in New Issue
Block a user