X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=read-cache.c;h=a917ab0cfe1547d1070f2567a41295c96f97b249;hb=bdf0ef0824ecca427ec04ac047ffe4aaf73ace5a;hp=efbb1be8748019785f774dab4e5580db39292385;hpb=e76d1bec04d342d84686ad9c5fd47f048fd94609;p=git.git diff --git a/read-cache.c b/read-cache.c index efbb1be8..a917ab0c 100644 --- a/read-cache.c +++ b/read-cache.c @@ -246,9 +246,9 @@ int cache_name_compare(const char *name1, int flags1, const char *name2, int fla if (len1 > len2) return 1; - /* Differences between "assume up-to-date" should not matter. */ - flags1 &= ~CE_VALID; - flags2 &= ~CE_VALID; + /* Compare stages */ + flags1 &= CE_STAGEMASK; + flags2 &= CE_STAGEMASK; if (flags1 < flags2) return -1; @@ -552,7 +552,7 @@ int read_cache(void) active_nr = ntohl(hdr->hdr_entries); active_alloc = alloc_nr(active_nr); - active_cache = calloc(active_alloc, sizeof(struct cache_entry *)); + active_cache = xcalloc(active_alloc, sizeof(struct cache_entry *)); offset = sizeof(*hdr); for (i = 0; i < active_nr; i++) {