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

Function check_ce_order

read-cache.c:1883–1906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1881}
1882
1883static void check_ce_order(struct index_state *istate)
1884{
1885 unsigned int i;
1886
1887 if (!verify_ce_order)
1888 return;
1889
1890 for (i = 1; i < istate->cache_nr; i++) {
1891 struct cache_entry *ce = istate->cache[i - 1];
1892 struct cache_entry *next_ce = istate->cache[i];
1893 int name_compare = strcmp(ce->name, next_ce->name);
1894
1895 if (0 < name_compare)
1896 die(_("unordered stage entries in index"));
1897 if (!name_compare) {
1898 if (!ce_stage(ce))
1899 die(_("multiple stage entries for merged file '%s'"),
1900 ce->name);
1901 if (ce_stage(ce) > ce_stage(next_ce))
1902 die(_("unordered stage entries for '%s'"),
1903 ce->name);
1904 }
1905 }
1906}
1907
1908static void tweak_untracked_cache(struct index_state *istate)
1909{

Callers 1

post_read_index_fromFunction · 0.85

Calls 1

dieFunction · 0.70

Tested by

no test coverage detected