path: root/upload-pack.c
diff options
authorChristian Couder <>2009-04-06 19:28:36 (GMT)
committerJunio C Hamano <>2009-04-08 05:12:38 (GMT)
commit11c211fa06fc396e8ee8132ef83e2f2763ff6976 (patch)
tree852484cc0f26ae0fd0f968b384040e591b09b9d0 /upload-pack.c
parente89aa6d2f546b2d4f2d88c15ce7e343751d6922f (diff)
list-objects: add "void *data" parameter to show functions
The goal of this patch is to get rid of the "static struct rev_info revs" static variable in "builtin-rev-list.c". To do that, we need to pass the revs to the "show_commit" function in "builtin-rev-list.c" and this in turn means that the "traverse_commit_list" function in "list-objects.c" must be passed functions pointers to functions with 2 parameters instead of one. So we have to change all the callers and all the functions passed to "traverse_commit_list". Anyway this makes the code more clean and more generic, so it should be a good thing in the long run. Signed-off-by: Christian Couder <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'upload-pack.c')
1 files changed, 3 insertions, 3 deletions
diff --git a/upload-pack.c b/upload-pack.c
index a49d872..495c99f 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -66,7 +66,7 @@ static ssize_t send_client_data(int fd, const char *data, ssize_t sz)
static FILE *pack_pipe = NULL;
-static void show_commit(struct commit *commit)
+static void show_commit(struct commit *commit, void *data)
if (commit->object.flags & BOUNDARY)
fputc('-', pack_pipe);
@@ -78,7 +78,7 @@ static void show_commit(struct commit *commit)
commit->buffer = NULL;
-static void show_object(struct object_array_entry *p)
+static void show_object(struct object_array_entry *p, void *data)
/* An object with name "foo\n0000000..." can be used to
* confuse downstream git-pack-objects very badly.
@@ -134,7 +134,7 @@ static int do_rev_list(int fd, void *create_full_pack)
if (prepare_revision_walk(&revs))
die("revision walk setup failed");
mark_edges_uninteresting(revs.commits, &revs, show_edge);
- traverse_commit_list(&revs, show_commit, show_object);
+ traverse_commit_list(&revs, show_commit, show_object, NULL);
return 0;