Merge branch 'cb/diff-fname-optim'
authorJunio C Hamano <gitster@pobox.com>
Wed, 17 Nov 2010 22:59:16 +0000 (14:59 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Nov 2010 22:59:16 +0000 (14:59 -0800)
* cb/diff-fname-optim:
  diff: avoid repeated scanning while looking for funcname
  do not search functions for patch ID
  add rebase patch id tests

1  2 
diff.c

diff --cc diff.c
index c8e43664fb8c01ecba9cf74b3f9cbf5e8c1cbaea,6dbb4b40fa7eccff62129368ea1a59f9b29fdb83..c248bc64c57b3206905dd8e6f72a702073a137cc
--- 1/diff.c
--- 2/diff.c
+++ b/diff.c
@@@ -3885,16 -3766,9 +3885,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);
        }