]> git.ipfire.org Git - thirdparty/git.git/commit - fetch-pack.c
fetch-pack: load tip_oids eagerly iff needed
authorRené Scharfe <l.s.r@web.de>
Thu, 4 Oct 2018 15:09:39 +0000 (17:09 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 4 Oct 2018 18:12:13 +0000 (11:12 -0700)
commit22a164651114738c723c4459140e1e5330491467
treebe200356f79268fbdadfbef90f89ef1ff29bc359
parentbf73282c0b34bfc7772f952496b06150cceb5dae
fetch-pack: load tip_oids eagerly iff needed

tip_oids_contain() lazily loads refs into an oidset at its first call.
It abuses the internal (sub)member .map.tablesize of that oidset to
check if it has done that already.

Determine if the oidset needs to be populated upfront and then do that
instead.  This duplicates a loop, but simplifies the existing one by
separating concerns between the two.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fetch-pack.c