diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-03-04 19:32:10 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-04 13:24:18 -0800 |
commit | 0f0d118c650fd0fe117063fbd196782b4f219410 (patch) | |
tree | e2b404c9b033aa348a84ec3d1f55e0d1322b50bb /t/t5601-clone.sh | |
parent | bundle: call strvec_clear() on allocated strvec (diff) | |
download | tgif-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 't/t5601-clone.sh')
0 files changed, 0 insertions, 0 deletions