- strcpy(old_sha1_hex, sha1_to_hex(old->sha1));
- printf("*%o->%o\t%s\t%s->%s\t%s%c", oldmode, mode,
- "blob",
- old_sha1_hex, sha1_to_hex(sha1),
- old->name, line_termination);
+ if (generate_patch)
+ diff_change(oldmode, mode,
+ old->sha1, sha1, old->name, NULL);
+ else {
+ strcpy(old_sha1_hex, sha1_to_hex(old->sha1));
+ printf("*%06o->%06o\tblob\t%s->%s\t%s%c", oldmode, mode,
+ old_sha1_hex, sha1_to_hex(sha1),
+ old->name, line_termination);
+ }