Commit 722ff7f
receive-pack: quarantine objects until pre-receive accepts
When a client pushes objects to us, index-pack checks the
objects themselves and then installs them into place. If we
then reject the push due to a pre-receive hook, we cannot
just delete the packfile; other processes may be depending
on it. We have to do a normal reachability check at this
point via `git gc`.
But such objects may hang around for weeks due to the
gc.pruneExpire grace period. And worse, during that time
they may be exploded from the pack into inefficient loose
objects.
Instead, this patch teaches receive-pack to put the new
objects into a "quarantine" temporary directory. We make
these objects available to the connectivity check and to the
pre-receive hook, and then install them into place only if
it is successful (and otherwise remove them as tempfiles).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 2564d99 commit 722ff7f
2 files changed
+76
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| 90 | + | |
| 91 | + | |
89 | 92 | | |
90 | 93 | | |
91 | 94 | | |
| |||
663 | 666 | | |
664 | 667 | | |
665 | 668 | | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
666 | 672 | | |
667 | 673 | | |
668 | 674 | | |
| |||
762 | 768 | | |
763 | 769 | | |
764 | 770 | | |
| 771 | + | |
765 | 772 | | |
766 | 773 | | |
767 | 774 | | |
| |||
833 | 840 | | |
834 | 841 | | |
835 | 842 | | |
| 843 | + | |
836 | 844 | | |
837 | 845 | | |
838 | 846 | | |
| |||
1240 | 1248 | | |
1241 | 1249 | | |
1242 | 1250 | | |
| 1251 | + | |
| 1252 | + | |
1243 | 1253 | | |
1244 | 1254 | | |
1245 | 1255 | | |
| 1256 | + | |
| 1257 | + | |
1246 | 1258 | | |
1247 | | - | |
| 1259 | + | |
1248 | 1260 | | |
| 1261 | + | |
1249 | 1262 | | |
1250 | 1263 | | |
1251 | 1264 | | |
| |||
1428 | 1441 | | |
1429 | 1442 | | |
1430 | 1443 | | |
| 1444 | + | |
1431 | 1445 | | |
1432 | 1446 | | |
1433 | 1447 | | |
| |||
1444 | 1458 | | |
1445 | 1459 | | |
1446 | 1460 | | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
1447 | 1474 | | |
1448 | 1475 | | |
1449 | 1476 | | |
| |||
1639 | 1666 | | |
1640 | 1667 | | |
1641 | 1668 | | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
1642 | 1681 | | |
1643 | 1682 | | |
1644 | 1683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments