fetch: pass transport to post-fetch connectivity check
When fetching with a transport that sets `self_contained_and_connected`
(as index-pack does for self-contained packs), check_connected() can
use find_pack_entry_one() to skip connectivity verification for refs
whose objects exist in the new pack. This avoids sending those OIDs to
the rev-list child process.
However, store_updated_refs() never passed the transport to
check_connected(), so opt.transport was always NULL and this
optimization was dead code for post-fetch connectivity checks.
Thread the transport parameter through store_updated_refs() and set
opt.transport so that check_connected() can take advantage of
self-contained packs.
On a large repository (2.4M commits, 374K files, 10.9K local refs),
fetching 200 new commits:
Before: rev-list connectivity check 22s, total fetch 36s
After: rev-list connectivity check 5s, total fetch 14s
The remaining 5s is spent verifying refs not contained in the new pack.
Signed-off-by: Kristofer Karlsson <krka@spotify.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>