Commit f63c79d
committed
pack-object: tolerate broken packs that have duplicated objects
When --reuse-delta is in effect (which is the default), and an existing
pack in the repository has the same object registered twice (e.g. one copy
in a non-delta format and the other copy in a delta against some other
object), an attempt to repack the repository can result in a cyclic delta
dependency, causing write_one() function to infinitely recurse into
itself.
Detect such a case and break the loopy dependency by writing out an object
that is involved in such a loop in the non-delta format.
Signed-off-by: Junio C Hamano <[email protected]>1 parent 6320526 commit f63c79d
1 file changed
+43
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
408 | | - | |
409 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
410 | 417 | | |
411 | 418 | | |
| 419 | + | |
412 | 420 | | |
413 | | - | |
414 | | - | |
415 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
416 | 435 | | |
417 | 436 | | |
418 | | - | |
419 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
420 | 451 | | |
421 | 452 | | |
422 | 453 | | |
423 | 454 | | |
424 | | - | |
425 | | - | |
| 455 | + | |
| 456 | + | |
426 | 457 | | |
427 | 458 | | |
428 | 459 | | |
429 | 460 | | |
430 | 461 | | |
431 | 462 | | |
432 | 463 | | |
433 | | - | |
| 464 | + | |
434 | 465 | | |
435 | 466 | | |
436 | 467 | | |
| |||
468 | 499 | | |
469 | 500 | | |
470 | 501 | | |
471 | | - | |
| 502 | + | |
472 | 503 | | |
473 | 504 | | |
474 | 505 | | |
| |||
0 commit comments