aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-08-31 16:24:48 -0700
committerJunio C Hamano <gitster@pobox.com>2010-08-31 16:24:48 -0700
commit7cc1e385a0b0caa27de714a6c7242b14bf023a65 (patch)
treed946391be671555b2ce561fada2d4d1bb3c6c93c /diff.c
parent0c1c798f20bb9956312247e091b23ba2e7baf7b4 (diff)
parent34597c1f5a77c710dae33092cb8a7cb01c6b21c1 (diff)
downloadgit-7cc1e385a0b0caa27de714a6c7242b14bf023a65.tar.gz
git-7cc1e385a0b0caa27de714a6c7242b14bf023a65.tar.xz
Merge branch 'cb/binary-patch-id'
* cb/binary-patch-id: hash binary sha1 into patch id
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 6fb97d462..144f2aaba 100644
--- a/diff.c
+++ b/diff.c
@@ -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;