Skip to content

Commit

Permalink
Merge branch 'cb/binary-patch-id'
Browse files Browse the repository at this point in the history
* cb/binary-patch-id:
  hash binary sha1 into patch id
  • Loading branch information
Junio C Hamano committed Aug 31, 2010
2 parents 0c1c798 + 34597c1 commit 7cc1e38
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7cc1e38

Please sign in to comment.