* Make sure we copy packfiles and their associated metafiles in the correct * order. All of these ends_with checks are slightly expensive to do in * the midst of a sorting routine, but in practice it shouldn't matter. * We will have a relatively small number of packfiles to order, and loose * objects exit early in the first line. */
| 191 | * objects exit early in the first line. |
| 192 | */ |
| 193 | static int pack_copy_priority(const char *name) |
| 194 | { |
| 195 | if (!starts_with(name, "pack")) |
| 196 | return 0; |
| 197 | if (ends_with(name, ".keep")) |
| 198 | return 1; |
| 199 | if (ends_with(name, ".pack")) |
| 200 | return 2; |
| 201 | if (ends_with(name, ".rev")) |
| 202 | return 3; |
| 203 | if (ends_with(name, ".idx")) |
| 204 | return 4; |
| 205 | return 5; |
| 206 | } |
| 207 | |
| 208 | static int pack_copy_cmp(const char *a, const char *b) |
| 209 | { |
no test coverage detected