summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2016-06-24 23:09:28 +0000
committerJunio C Hamano <gitster@pobox.com>2016-06-28 11:39:02 -0700
commit4e8161a82e5449976392517968b2d1bb56109b29 (patch)
tree552b128d238cb8ac3176ba31792a32866c390364 /merge-recursive.c
parentb4da9d62f91d66ab97815007105b42a2aa5846b5 (diff)
downloadgit-4e8161a82e5449976392517968b2d1bb56109b29.tar.gz
merge-recursive: convert merge_recursive_generic() to object_id
Convert this function and the git merge-recursive subcommand to use struct object_id. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 7bbd4aea69..48fe7e7386 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1982,11 +1982,11 @@ int merge_recursive(struct merge_options *o,
return clean;
}
-static struct commit *get_ref(const unsigned char *sha1, const char *name)
+static struct commit *get_ref(const struct object_id *oid, const char *name)
{
struct object *object;
- object = deref_tag(parse_object(sha1), name, strlen(name));
+ object = deref_tag(parse_object(oid->hash), name, strlen(name));
if (!object)
return NULL;
if (object->type == OBJ_TREE)
@@ -1999,10 +1999,10 @@ static struct commit *get_ref(const unsigned char *sha1, const char *name)
}
int merge_recursive_generic(struct merge_options *o,
- const unsigned char *head,
- const unsigned char *merge,
+ const struct object_id *head,
+ const struct object_id *merge,
int num_base_list,
- const unsigned char **base_list,
+ const struct object_id **base_list,
struct commit **result)
{
int clean;
@@ -2015,9 +2015,9 @@ int merge_recursive_generic(struct merge_options *o,
int i;
for (i = 0; i < num_base_list; ++i) {
struct commit *base;
- if (!(base = get_ref(base_list[i], sha1_to_hex(base_list[i]))))
+ if (!(base = get_ref(base_list[i], oid_to_hex(base_list[i]))))
return error(_("Could not parse object '%s'"),
- sha1_to_hex(base_list[i]));
+ oid_to_hex(base_list[i]));
commit_list_insert(base, &ca);
}
}