| 1881 | } |
| 1882 | |
| 1883 | static 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 | |
| 1908 | static void tweak_untracked_cache(struct index_state *istate) |
| 1909 | { |
no test coverage detected