- if (ce->mtime.sec != (unsigned int)st->st_mtim.tv_sec ||
- ce->mtime.nsec != (unsigned int)st->st_mtim.tv_nsec)
- changed |= MTIME_CHANGED;
- if (ce->ctime.sec != (unsigned int)st->st_ctim.tv_sec ||
- ce->ctime.nsec != (unsigned int)st->st_ctim.tv_nsec)
- changed |= CTIME_CHANGED;
- if (ce->st_uid != (unsigned int)st->st_uid ||
- ce->st_gid != (unsigned int)st->st_gid)
- changed |= OWNER_CHANGED;
- if (ce->st_mode != (unsigned int)st->st_mode)
- changed |= MODE_CHANGED;
- if (ce->st_dev != (unsigned int)st->st_dev ||
- ce->st_ino != (unsigned int)st->st_ino)
- changed |= INODE_CHANGED;
- if (ce->st_size != (unsigned int)st->st_size)
- changed |= DATA_CHANGED;
- return changed;
+static void show_file(int pfx, struct cache_entry *ce)
+{
+ if (generate_patch)
+ diff_addremove(pfx, ntohl(ce->ce_mode), ce->sha1,
+ ce->name, NULL);
+ else
+ printf("%c%06o\t%s\t%s\t%s%c",
+ pfx, ntohl(ce->ce_mode), "blob",
+ sha1_to_hex(ce->sha1), ce->name, line_termination);