X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=diff.c;h=c845c871130a8943c3c5f5d46cfd52426180fc8b;hb=be65e7d9fbd3ae6fc097cedade2afe39805fcf4e;hp=6762fcee5af881b93b97da2dff190137768c1a8e;hpb=e5de2c5e308a23b8f1531bbac2f100af7ab0767b;p=git.git diff --git a/diff.c b/diff.c index 6762fcee..c845c871 100644 --- a/diff.c +++ b/diff.c @@ -1018,14 +1018,12 @@ static void run_diff(struct diff_filepair *p, struct diff_options *o) } if (memcmp(one->sha1, two->sha1, 20)) { - char one_sha1[41]; int abbrev = o->full_index ? 40 : DEFAULT_ABBREV; - memcpy(one_sha1, sha1_to_hex(one->sha1), 41); len += snprintf(msg + len, sizeof(msg) - len, "index %.*s..%.*s", - abbrev, one_sha1, abbrev, - sha1_to_hex(two->sha1)); + abbrev, sha1_to_hex(one->sha1), + abbrev, sha1_to_hex(two->sha1)); if (one->mode == two->mode) len += snprintf(msg + len, sizeof(msg) - len, " %06o", one->mode);