diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-09-01 01:24:48 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-01 01:24:48 +0200 |
commit | 7cc1e385a0b0caa27de714a6c7242b14bf023a65 (patch) | |
tree | d946391be671555b2ce561fada2d4d1bb3c6c93c /diff.c | |
parent | Merge branch 'ab/maint-reset-mixed-w-pathspec-advice' (diff) | |
parent | hash binary sha1 into patch id (diff) | |
download | git-7cc1e385a0b0caa27de714a6c7242b14bf023a65.tar.xz git-7cc1e385a0b0caa27de714a6c7242b14bf023a65.zip |
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.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; |