X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=builtin-diff.c;h=a6590205e8f746304f3d06d3e328a05bf2bf954e;hb=173a9cbe7031bc3574b3f41cb2d2375cf959ff2a;hp=40e5c96f30e3d638c09b276805158bdba3ddde58;hpb=8e3abd4c97b8e7e1128ad0cc44dcc267f478659a;p=git.git diff --git a/builtin-diff.c b/builtin-diff.c index 40e5c96f3..a6590205e 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -69,7 +69,7 @@ static void stuff_change(struct diff_options *opt, struct diff_filespec *one, *two; if (!is_null_sha1(old_sha1) && !is_null_sha1(new_sha1) && - !memcmp(old_sha1, new_sha1, 20)) + !hashcmp(old_sha1, new_sha1)) return; if (opt->reverse_diff) { @@ -192,7 +192,7 @@ static int builtin_diff_combined(struct rev_info *revs, parent = xmalloc(ents * sizeof(*parent)); /* Again, the revs are all reverse */ for (i = 0; i < ents; i++) - memcpy(parent + i, ent[ents - 1 - i].item->sha1, 20); + hashcpy((unsigned char*)parent + i, ent[ents - 1 - i].item->sha1); diff_tree_combined(parent[0], parent + 1, ents - 1, revs->dense_combined_merges, revs); return 0; @@ -290,7 +290,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix) if (obj->type == OBJ_BLOB) { if (2 <= blobs) die("more than two blobs given: '%s'", name); - memcpy(blob[blobs].sha1, obj->sha1, 20); + hashcpy(blob[blobs].sha1, obj->sha1); blob[blobs].name = name; blobs++; continue;