list-objects: add "void *data" parameter to show functions
[git/git.git] / list-objects.c
index c8b8375..208a4cb 100644 (file)
@@ -137,8 +137,9 @@ void mark_edges_uninteresting(struct commit_list *list,
 }
 
 void traverse_commit_list(struct rev_info *revs,
-                         void (*show_commit)(struct commit *),
-                         void (*show_object)(struct object_array_entry *))
+                         show_commit_fn show_commit,
+                         show_object_fn show_object,
+                         void *data)
 {
        int i;
        struct commit *commit;
@@ -146,7 +147,7 @@ void traverse_commit_list(struct rev_info *revs,
 
        while ((commit = get_revision(revs)) != NULL) {
                process_tree(revs, commit->tree, &objects, NULL, "");
-               show_commit(commit);
+               show_commit(commit, data);
        }
        for (i = 0; i < revs->pending.nr; i++) {
                struct object_array_entry *pending = revs->pending.objects + i;
@@ -173,7 +174,7 @@ void traverse_commit_list(struct rev_info *revs,
                    sha1_to_hex(obj->sha1), name);
        }
        for (i = 0; i < objects.nr; i++)
-               show_object(&objects.objects[i]);
+               show_object(&objects.objects[i], data);
        free(objects.objects);
        if (revs->pending.nr) {
                free(revs->pending.objects);