Repository navigation
Commit ac181a3
committed
cat-file: snapshot pack indexes before enumerating all objects
The previous commit made "git cat-file --batch-all-objects" error out
when a concurrent repack removes a pack mid-walk. That is correct but
pessimistic on servers that repack often.
Reduce how often it triggers by opening every pack index up front,
before the walk. An index mmap survives unlink() of the .idx and pack
fd pressure (close_one_pack() closes only the pack fd), so the object
set is fixed once the indexes are open. For --batch-all-objects this
adds no work: the walk opens every index anyway.
Like f6b2625 (fsck: snapshot default refs before object walk,
2026-01-09), this narrows rather than closes the race; the residue is
still caught by the previous commit rather than silently dropped.
Assisted-by: Claude Opus 4.8
Signed-off-by: Elijah Newren <newren@gmail.com>1 parent 5591ca7 commit ac181a3
1 file changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1020 | 1037 | | |
1021 | 1038 | | |
1022 | 1039 | | |
| |||
1084 | 1101 | | |
1085 | 1102 | | |
1086 | 1103 | | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1087 | 1109 | | |
1088 | 1110 | | |
1089 | 1111 | | |
| |||
0 commit comments