1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-08 06:36:10 +02:00

Merge branch 'cb/binary-patch-id'

* cb/binary-patch-id:
  hash binary sha1 into patch id
This commit is contained in:
Junio C Hamano 2010-08-31 16:24:48 -07:00
commit 7cc1e385a0

7
diff.c
View File

@ -3853,6 +3853,13 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
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;