Commit 3ba3d06
pack-bitmap-write.c: gracefully fail to write non-closed bitmaps
The set of objects covered by a bitmap must be closed under
reachability, since it must be the case that there is a valid bit
position assigned for every possible reachable object (otherwise the
bitmaps would be incomplete).
Pack bitmaps are never written from 'git repack' unless repacking
all-into-one, and so we never write non-closed bitmaps (except in the
case of partial clones where we aren't guaranteed to have all objects).
But multi-pack bitmaps change this, since it isn't known whether the
set of objects in the MIDX is closed under reachability until walking
them. Plumb through a bit that is set when a reachable object isn't
found.
As soon as a reachable object isn't found in the set of objects to
include in the bitmap, bitmap_writer_build() knows that the set is not
closed, and so it now fails gracefully.
A test is added in t0410 to trigger a bitmap write without full
reachability closure by removing local copies of some reachable objects
from a promisor remote.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent fa95666 commit 3ba3d06
File tree
4 files changed
+64
-26
lines changed- builtin
- t
4 files changed
+64
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1256 | 1256 | | |
1257 | 1257 | | |
1258 | 1258 | | |
1259 | | - | |
| 1259 | + | |
| 1260 | + | |
1260 | 1261 | | |
1261 | 1262 | | |
1262 | 1263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
| 140 | + | |
| 141 | + | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
| |||
331 | 336 | | |
332 | 337 | | |
333 | 338 | | |
334 | | - | |
335 | | - | |
| 339 | + | |
| 340 | + | |
336 | 341 | | |
| 342 | + | |
337 | 343 | | |
338 | 344 | | |
339 | 345 | | |
| |||
342 | 348 | | |
343 | 349 | | |
344 | 350 | | |
345 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
346 | 354 | | |
347 | | - | |
| 355 | + | |
348 | 356 | | |
349 | 357 | | |
350 | 358 | | |
| |||
355 | 363 | | |
356 | 364 | | |
357 | 365 | | |
358 | | - | |
359 | | - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
360 | 369 | | |
361 | 370 | | |
362 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
363 | 375 | | |
364 | 376 | | |
365 | 377 | | |
| |||
368 | 380 | | |
369 | 381 | | |
370 | 382 | | |
| 383 | + | |
371 | 384 | | |
372 | 385 | | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
379 | 392 | | |
| 393 | + | |
| 394 | + | |
380 | 395 | | |
381 | 396 | | |
382 | 397 | | |
| |||
401 | 416 | | |
402 | 417 | | |
403 | 418 | | |
404 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
405 | 423 | | |
406 | 424 | | |
407 | 425 | | |
408 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
409 | 429 | | |
410 | 430 | | |
411 | 431 | | |
412 | 432 | | |
413 | 433 | | |
414 | 434 | | |
415 | 435 | | |
416 | | - | |
417 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
418 | 442 | | |
419 | 443 | | |
420 | 444 | | |
| |||
432 | 456 | | |
433 | 457 | | |
434 | 458 | | |
435 | | - | |
| 459 | + | |
436 | 460 | | |
437 | 461 | | |
438 | 462 | | |
| |||
441 | 465 | | |
442 | 466 | | |
443 | 467 | | |
| 468 | + | |
444 | 469 | | |
445 | 470 | | |
446 | 471 | | |
| |||
463 | 488 | | |
464 | 489 | | |
465 | 490 | | |
466 | | - | |
467 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
468 | 496 | | |
469 | 497 | | |
470 | 498 | | |
| |||
499 | 527 | | |
500 | 528 | | |
501 | 529 | | |
502 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
503 | 533 | | |
504 | 534 | | |
505 | 535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
540 | 546 | | |
541 | 547 | | |
542 | 548 | | |
| |||
561 | 567 | | |
562 | 568 | | |
563 | 569 | | |
| 570 | + | |
564 | 571 | | |
565 | 572 | | |
566 | 573 | | |
| |||
0 commit comments