+ *sha1p = sha1;
+ *modep = mode;
+ return 0;
+}
+
+static void show_new_file(struct cache_entry *new)
+{
+ unsigned char *sha1;
+ unsigned int mode;
+
+ /* New file in the index: it might actually be different in the working copy */
+ if (get_stat_data(new, &sha1, &mode) < 0)
+ return;
+
+ show_file("+", new, sha1, mode);
+}
+
+static int show_modified(struct cache_entry *old, struct cache_entry *new)
+{
+ unsigned int mode, oldmode;
+ unsigned char *sha1;
+ unsigned char old_sha1_hex[60];
+
+ if (get_stat_data(new, &sha1, &mode) < 0) {
+ show_file("-", old, old->sha1, old->ce_mode);
+ return -1;
+ }
+
+ oldmode = old->ce_mode;