Commit 95e833e
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>1 parent 6a4418c commit 95e833e
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1213 | 1213 | | |
1214 | 1214 | | |
1215 | 1215 | | |
| 1216 | + | |
1216 | 1217 | | |
1217 | 1218 | | |
1218 | 1219 | | |
| |||
1228 | 1229 | | |
1229 | 1230 | | |
1230 | 1231 | | |
| 1232 | + | |
1231 | 1233 | | |
1232 | 1234 | | |
1233 | 1235 | | |
| |||
1432 | 1434 | | |
1433 | 1435 | | |
1434 | 1436 | | |
1435 | | - | |
| 1437 | + | |
1436 | 1438 | | |
1437 | 1439 | | |
1438 | 1440 | | |
| |||
0 commit comments