- pathlen1 = strlen(path1);
- pathlen2 = strlen(path2);
- cmp = cache_name_compare(path1, pathlen1, path2, pathlen2);
- if (cmp < 0) {
- if (S_ISDIR(mode1)) {
- char type[20];
- unsigned long size;
- void *tree = read_sha1_file(sha1, type, &size);
- char *newbase = malloc(baselen + 2 + pathlen1);
-
- memcpy(newbase, base, baselen);
- memcpy(newbase + baselen, path1, pathlen1);
- memcpy(newbase + baselen + pathlen1, "/", 2);
- if (!tree || strcmp(type, "tree"))
- die("unable to read tree object %s", sha1_to_hex(sha1));
- *entries = diff_cache(tree, size, ac, *entries, newbase);
- free(newbase);
- free(tree);
- return -1;
- }
- show_file("-", path1, mode1, sha1, base);
+ if (get_stat_data(new, &sha1, &mode) < 0) {
+ show_file("-", old, old->sha1, old->ce_mode);