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

Function compare_prefix

refs/iterator.c:322–333  ·  view source on GitHub ↗

Return -1, 0, 1 if refname is before, inside, or after the prefix. */

Source from the content-addressed store, hash-verified

320
321/* Return -1, 0, 1 if refname is before, inside, or after the prefix. */
322static int compare_prefix(const char *refname, const char *prefix)
323{
324 while (*prefix) {
325 if (*refname != *prefix)
326 return ((unsigned char)*refname < (unsigned char)*prefix) ? -1 : +1;
327
328 refname++;
329 prefix++;
330 }
331
332 return 0;
333}
334
335static int prefix_ref_iterator_advance(struct ref_iterator *ref_iterator)
336{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected