X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-diff.c;h=a6590205e8f746304f3d06d3e328a05bf2bf954e;hb=9d0524d42f340fc49f9e175d966afb7dce3854bb;hp=874f773421620642425e67f650de2a34396f1c0f;hpb=a89fccd28197fa179828c8596791ff16e2268d20;p=git.git diff --git a/builtin-diff.c b/builtin-diff.c index 874f77342..a6590205e 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -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;