提交 635170f2 编写于 作者: M Michael Haggerty 提交者: Junio C Hamano

add_one_ref(): rewrite to take an object_id argument

Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Nbrian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 fd95035f
......@@ -22,9 +22,10 @@ static void update_progress(struct connectivity_progress *cp)
display_progress(cp->progress, cp->count);
}
static int add_one_ref(const char *path, const unsigned char *sha1, int flag, void *cb_data)
static int add_one_ref(const char *path, const struct object_id *oid,
int flag, void *cb_data)
{
struct object *object = parse_object_or_die(sha1, path);
struct object *object = parse_object_or_die(oid->hash, path);
struct rev_info *revs = (struct rev_info *)cb_data;
add_pending_object(revs, object, "");
......@@ -155,8 +156,6 @@ void mark_reachable_objects(struct rev_info *revs, int mark_reflog,
struct progress *progress)
{
struct connectivity_progress cp;
struct each_ref_fn_sha1_adapter wrapped_add_one_ref =
{add_one_ref, revs};
/*
* Set up revision parsing, and mark us as being interested
......@@ -170,10 +169,10 @@ void mark_reachable_objects(struct rev_info *revs, int mark_reflog,
add_index_objects_to_pending(revs, 0);
/* Add all external refs */
for_each_ref(each_ref_fn_adapter, &wrapped_add_one_ref);
for_each_ref(add_one_ref, revs);
/* detached HEAD is not included in the list above */
head_ref(each_ref_fn_adapter, &wrapped_add_one_ref);
head_ref(add_one_ref, revs);
/* Add all reflog info */
if (mark_reflog)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册