diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2015-11-10 02:22:28 +0000 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2015-11-20 08:02:05 -0500 |
commit | f2fd0760f62e79609fef7bfd7ecebb002e8e4ced (patch) | |
tree | 1f915114b015428730e95a89697783560b672008 /merge-recursive.c | |
parent | 7999b2cf772956466baa8925491d6fb1b0963292 (diff) | |
download | git-f2fd0760f62e79609fef7bfd7ecebb002e8e4ced.tar.gz |
Convert struct object to object_id
struct object is one of the major data structures dealing with object
IDs. Convert it to use struct object_id instead of an unsigned char
array. Convert get_object_hash to refer to the new member as well.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r-- | merge-recursive.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/merge-recursive.c b/merge-recursive.c index 60ab95d055..cd34ae551c 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -26,17 +26,17 @@ static struct tree *shift_tree_object(struct tree *one, struct tree *two, const char *subtree_shift) { - unsigned char shifted[20]; + struct object_id shifted; if (!*subtree_shift) { - shift_tree(get_object_hash(one->object), get_object_hash(two->object), shifted, 0); + shift_tree(get_object_hash(one->object), get_object_hash(two->object), shifted.hash, 0); } else { - shift_tree_by(get_object_hash(one->object), get_object_hash(two->object), shifted, + shift_tree_by(get_object_hash(one->object), get_object_hash(two->object), shifted.hash, subtree_shift); } - if (!hashcmp(two->object.sha1, shifted)) + if (!oidcmp(&two->object.oid, &shifted)) return two; - return lookup_tree(shifted); + return lookup_tree(shifted.hash); } static struct commit *make_virtual_commit(struct tree *tree, const char *comment) @@ -1823,8 +1823,8 @@ int merge_trees(struct merge_options *o, if (code != 0) { if (show(o, 4) || o->call_depth) die(_("merging of trees %s and %s failed"), - sha1_to_hex(head->object.sha1), - sha1_to_hex(merge->object.sha1)); + oid_to_hex(&head->object.oid), + oid_to_hex(&merge->object.oid)); else exit(128); } |