diff-tree: fix "whole sub-tree disappeared or appeared" case
[git.git] / update-cache.c
index 3b44fe1..a6f9d6c 100644 (file)
@@ -191,7 +191,7 @@ static struct cache_entry *refresh_entry(struct cache_entry *ce)
        if (lstat(ce->name, &st) < 0)
                return ERR_PTR(-errno);
 
-       changed = cache_match_stat(ce, &st);
+       changed = ce_match_stat(ce, &st);
        if (!changed)
                return ce;
 
@@ -249,6 +249,9 @@ static int refresh_cache(void)
                        continue;
                }
                active_cache_changed = 1;
+               /* You can NOT just free active_cache[i] here, since it
+                * might not be necessarily malloc()ed but can also come
+                * from mmap(). */
                active_cache[i] = new;
        }
        return has_errors;