Commit 5b3e9a8
committed
odb: add write_packfile, for_each_unique_abbrev, convert_object_id
Add three vtable methods to odb_source that were not part of the
recent ps/odb-sources and ps/object-counting series:
- write_packfile: ingest a pack from a file descriptor. The files
backend chooses between index-pack (large packs) and
unpack-objects (small packs below fetch.unpackLimit). Options
cover thin-pack fixing, promisor marking, fsck, lockfile
capture, and shallow file passing.
- for_each_unique_abbrev: iterate objects matching a hex prefix
for disambiguation. Searches loose objects via oidtree, then
multi-pack indices, then non-MIDX packs.
- convert_object_id: translate between hash algorithms using the
loose object map. Used during SHA-1 to SHA-256 migration.
Also add ODB_SOURCE_HELPER to the source type enum, preparing for
the helper backend in the next commit.
The write_packfile vtable method replaces the pattern where callers
spawn index-pack/unpack-objects directly. fast-import already uses
odb_write_packfile() and this allows non-files backends to handle
pack ingestion through their own mechanism.
Signed-off-by: Aaron Paterson <apaterson@pm.me>1 parent 41688c1 commit 5b3e9a8
File tree
6 files changed
+498
-36
lines changed- builtin
- odb
6 files changed
+498
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
879 | | - | |
880 | | - | |
881 | 879 | | |
882 | | - | |
883 | 880 | | |
884 | 881 | | |
885 | 882 | | |
| |||
891 | 888 | | |
892 | 889 | | |
893 | 890 | | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
900 | 894 | | |
901 | | - | |
902 | | - | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
903 | 898 | | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
910 | 905 | | |
911 | 906 | | |
912 | 907 | | |
913 | | - | |
| 908 | + | |
| 909 | + | |
914 | 910 | | |
915 | 911 | | |
916 | 912 | | |
| |||
1239 | 1235 | | |
1240 | 1236 | | |
1241 | 1237 | | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
1242 | 1249 | | |
1243 | 1250 | | |
1244 | 1251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
117 | 126 | | |
118 | | - | |
119 | | - | |
120 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
121 | 137 | | |
122 | 138 | | |
123 | 139 | | |
| |||
208 | 224 | | |
209 | 225 | | |
210 | 226 | | |
211 | | - | |
212 | | - | |
213 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
214 | 236 | | |
215 | 237 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
220 | 244 | | |
221 | 245 | | |
222 | 246 | | |
| |||
796 | 820 | | |
797 | 821 | | |
798 | 822 | | |
799 | | - | |
| 823 | + | |
| 824 | + | |
800 | 825 | | |
801 | | - | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
802 | 830 | | |
| 831 | + | |
| 832 | + | |
803 | 833 | | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
808 | 848 | | |
809 | 849 | | |
810 | | - | |
811 | | - | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
812 | 855 | | |
813 | 856 | | |
814 | 857 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
981 | 981 | | |
982 | 982 | | |
983 | 983 | | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
984 | 1010 | | |
985 | 1011 | | |
986 | 1012 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
573 | 592 | | |
574 | 593 | | |
575 | 594 | | |
| |||
0 commit comments