summaryrefslogtreecommitdiff
path: root/builtin/merge-tree.c
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2022-03-04 19:32:10 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-03-04 13:24:18 -0800
commit0f0d118c650fd0fe117063fbd196782b4f219410 (patch)
treee2b404c9b033aa348a84ec3d1f55e0d1322b50bb /builtin/merge-tree.c
parentbundle: call strvec_clear() on allocated strvec (diff)
downloadtgif-0f0d118c650fd0fe117063fbd196782b4f219410.tar.xz
transport: stop needlessly copying bundle header references
Amend the logic added in fddf2ebe388 (transport: teach all vtables to allow fetch first, 2019-08-21) and save ourselves pointless work in fetch_refs_from_bundle(). The fetch_refs_from_bundle() caller doesn't care about the "struct ref *result" return value of get_refs_from_bundle(), and doesn't need any of the work we were doing in looping over the "data->header.references" in get_refs_from_bundle(). So this change saves us work, and also fixes a memory leak that we had when called from fetch_refs_from_bundle(). The other caller of get_refs_from_bundle() is the "get_refs_list" member we set up for the "struct transport_vtable bundle_vtable". That caller does care about the "struct ref *result" return value. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge-tree.c')
0 files changed, 0 insertions, 0 deletions