Commit c3690c9
builtin/repack.c: use a string_list for 'midx_pack_names'
When writing a new MIDX, repack must determine whether or not there are
any packs in the MIDX it is replacing (if one exists) that are not
somehow represented in the new MIDX (e.g., either by preserving the pack
verbatim, or rolling it up as part of a geometric repack, etc.).
In order to do this, it keeps track of a list of pack names from the
MIDX present in the repository at the start of the repack operation.
Since we manipulate and close the object store, we cannot rely on the
repository's in-core representation of the MIDX, since this is subject
to change and/or go away.
When this behavior was introduced in 5ee86c2 (repack: exclude cruft
pack(s) from the MIDX where possible, 2025-06-23), we maintained an
array of character pointers instead of using a convenience API, such as
string-list.h.
Store the list of MIDX pack names in a string_list, thereby reducing the
number of parameters we have to pass to `midx_has_unknown_packs()`.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent e6b0907 commit c3690c9
1 file changed
Lines changed: 17 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
| 121 | + | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
126 | 125 | | |
127 | | - | |
| 126 | + | |
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
131 | | - | |
132 | | - | |
| 130 | + | |
| 131 | + | |
133 | 132 | | |
134 | 133 | | |
135 | 134 | | |
| |||
191 | 190 | | |
192 | 191 | | |
193 | 192 | | |
194 | | - | |
195 | | - | |
| 193 | + | |
196 | 194 | | |
197 | 195 | | |
198 | 196 | | |
| |||
247 | 245 | | |
248 | 246 | | |
249 | 247 | | |
250 | | - | |
251 | | - | |
| 248 | + | |
| 249 | + | |
252 | 250 | | |
253 | 251 | | |
254 | 252 | | |
| |||
606 | 604 | | |
607 | 605 | | |
608 | 606 | | |
| 607 | + | |
609 | 608 | | |
610 | 609 | | |
611 | 610 | | |
612 | 611 | | |
613 | 612 | | |
614 | | - | |
615 | | - | |
616 | 613 | | |
617 | 614 | | |
618 | 615 | | |
| |||
985 | 982 | | |
986 | 983 | | |
987 | 984 | | |
988 | | - | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | | - | |
993 | | - | |
994 | | - | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
995 | 991 | | |
996 | 992 | | |
997 | 993 | | |
| |||
1019 | 1015 | | |
1020 | 1016 | | |
1021 | 1017 | | |
1022 | | - | |
1023 | | - | |
| 1018 | + | |
| 1019 | + | |
1024 | 1020 | | |
1025 | 1021 | | |
1026 | 1022 | | |
| |||
1067 | 1063 | | |
1068 | 1064 | | |
1069 | 1065 | | |
| 1066 | + | |
1070 | 1067 | | |
1071 | 1068 | | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
1075 | 1069 | | |
1076 | 1070 | | |
1077 | 1071 | | |
| |||
0 commit comments