MCPcopy Create free account
hub / github.com/git/git / pack_copy_priority

Function pack_copy_priority

tmp-objdir.c:193–206  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

191 * objects exit early in the first line.
192 */
193static 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
208static int pack_copy_cmp(const char *a, const char *b)
209{

Callers 1

pack_copy_cmpFunction · 0.85

Calls 2

starts_withFunction · 0.85
ends_withFunction · 0.85

Tested by

no test coverage detected