Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-05-25 21:39:00 +0300
committerJunio C Hamano <gitster@pobox.com>2015-05-25 22:19:34 +0300
commit635170f2bb34116441b562a93d3ce37ae4373ecc (patch)
treeb2713a90ff1fc94bdef36c2ba3a8e8f9a92fa6ae /reachable.c
parentfd95035fdb817f228b6e5223883dcda081bde546 (diff)
add_one_ref(): rewrite to take an object_id argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reachable.c')
-rw-r--r--reachable.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/reachable.c b/reachable.c
index acac86ad3f..9cff25b490 100644
--- a/reachable.c
+++ b/reachable.c
@@ -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)