X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=diff.c;h=c845c871130a8943c3c5f5d46cfd52426180fc8b;hb=dcb3450fd8785d76dd3d25aa49be66190aa5e7f3;hp=6762fcee5af881b93b97da2dff190137768c1a8e;hpb=935e714204fe167aa6172a733e7131ee5b4577f4;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);