append_matching_ref(): rewrite to take an object_id argument
[gitweb.git] / reachable.c
index a647267ae9cb94d960810f470993ba22cbe3763d..acac86ad3fae736a326774885b5f7380b03901bb 100644 (file)
@@ -142,10 +142,12 @@ int add_unseen_recent_objects_to_traversal(struct rev_info *revs,
        data.revs = revs;
        data.timestamp = timestamp;
 
-       r = for_each_loose_object(add_recent_loose, &data);
+       r = for_each_loose_object(add_recent_loose, &data,
+                                 FOR_EACH_OBJECT_LOCAL_ONLY);
        if (r)
                return r;
-       return for_each_packed_object(add_recent_packed, &data);
+       return for_each_packed_object(add_recent_packed, &data,
+                                     FOR_EACH_OBJECT_LOCAL_ONLY);
 }
 
 void mark_reachable_objects(struct rev_info *revs, int mark_reflog,
@@ -153,6 +155,8 @@ 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
@@ -166,10 +170,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(add_one_ref, revs);
+       for_each_ref(each_ref_fn_adapter, &wrapped_add_one_ref);
 
        /* detached HEAD is not included in the list above */
-       head_ref(add_one_ref, revs);
+       head_ref(each_ref_fn_adapter, &wrapped_add_one_ref);
 
        /* Add all reflog info */
        if (mark_reflog)