From: Junio C Hamano Date: Wed, 24 Nov 2010 20:46:26 +0000 (-0800) Subject: Merge branch 'cb/diff-fname-optim' into maint X-Git-Tag: v1.7.3.3~20 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9cffe2018a8c400cbd50a8aec4eddea97c4ede2f;p=git.git Merge branch 'cb/diff-fname-optim' into maint * cb/diff-fname-optim: diff: avoid repeated scanning while looking for funcname do not search functions for patch ID add rebase patch id tests --- 9cffe2018a8c400cbd50a8aec4eddea97c4ede2f diff --cc diff.c index 095a23863,6dbb4b40f..b829c0335 --- a/diff.c +++ b/diff.c @@@ -3861,16 -3766,9 +3861,16 @@@ static int diff_get_patch_id(struct dif len2, p->two->path); git_SHA1_Update(&ctx, buffer, len1); + if (diff_filespec_is_binary(p->one) || + diff_filespec_is_binary(p->two)) { + git_SHA1_Update(&ctx, sha1_to_hex(p->one->sha1), 40); + git_SHA1_Update(&ctx, sha1_to_hex(p->two->sha1), 40); + continue; + } + xpp.flags = 0; xecfg.ctxlen = 3; - xecfg.flags = XDL_EMIT_FUNCNAMES; + xecfg.flags = 0; xdi_diff_outf(&mf1, &mf2, patch_id_consume, &data, &xpp, &xecfg); }