+static void show_diff_empty(struct cache_entry *ce)
+{
+ char *old;
+ unsigned long int size;
+ int lines=0;
+ unsigned char type[20], *p, *end;
+
+ old = read_sha1_file(ce->sha1, type, &size);
+ if (size > 0) {
+ int startline = 1;
+ int c = 0;
+
+ printf("--- %s\n", ce->name);
+ printf("+++ /dev/null\n");
+ p = old;
+ end = old + size;
+ while (p < end)
+ if (*p++ == '\n')
+ lines ++;
+ printf("@@ -1,%d +0,0 @@\n", lines);
+ p = old;
+ while (p < end) {
+ c = *p++;
+ if (startline) {
+ putchar('-');
+ startline = 0;
+ }
+ putchar(c);
+ if (c == '\n')
+ startline = 1;
+ }
+ if (c!='\n')
+ printf("\n");
+ fflush(stdout);
+ }
+}
+