Skip to content

Commit 7cc1e38

Browse files
committed
Merge branch 'cb/binary-patch-id'
* cb/binary-patch-id: hash binary sha1 into patch id
2 parents 0c1c798 + 34597c1 commit 7cc1e38

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

diff.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3853,6 +3853,13 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1)
38533853
len2, p->two->path);
38543854
git_SHA1_Update(&ctx, buffer, len1);
38553855

3856+
if (diff_filespec_is_binary(p->one) ||
3857+
diff_filespec_is_binary(p->two)) {
3858+
git_SHA1_Update(&ctx, sha1_to_hex(p->one->sha1), 40);
3859+
git_SHA1_Update(&ctx, sha1_to_hex(p->two->sha1), 40);
3860+
continue;
3861+
}
3862+
38563863
xpp.flags = 0;
38573864
xecfg.ctxlen = 3;
38583865
xecfg.flags = XDL_EMIT_FUNCNAMES;

0 commit comments

Comments
 (0)