Commit Diff


commit - 45b73774db7347e94e5a3071b8f786e2374a0261
commit + 917bfd05b82e9f84999cfbb008c9dcefd388f77f
blob - 1c726ce309340e2b2f257183473fedbfde9852ea
blob + ce9c8329ed958373dff3c02191c71ba63dee27ef
--- lib/got_lib_object_idset.h
+++ lib/got_lib_object_idset.h
@@ -27,5 +27,5 @@ const struct got_error *got_object_idset_remove(struct
 int got_object_idset_contains(struct got_object_idset *,
     struct got_object_id *);
 void got_object_idset_for_each(struct got_object_idset *,
-    void (*cb)(struct got_object_id *, void *));
+    void (*cb)(struct got_object_id *, void *, void *), void *);
 unsigned int got_object_idset_num_elements(struct got_object_idset *);
blob - 3487cfbba9d65ce8edd1d7fb5cf626f3dc082dda
blob + 2fa47dfcb44d0cc960edab73d4d1d50baaa5f7a1
--- lib/object_idset.c
+++ lib/object_idset.c
@@ -196,14 +196,14 @@ got_object_idset_contains(struct got_object_idset *set
 }
 
 void got_object_idset_for_each(struct got_object_idset *set,
-    void (*cb)(struct got_object_id *, void *))
+    void (*cb)(struct got_object_id *, void *, void *), void *arg)
 {
 	struct got_object_idset_element *entry;
 	int i;
 
 	for (i = 0; i < nitems(set->entries); i++) {
 		TAILQ_FOREACH(entry, &set->entries[i], entry)
-			cb(&entry->id, entry->data);
+			cb(&entry->id, entry->data, arg);
 	}
 }
 
blob - 78476ec30e05779d3f631f32fc0b784df2d99d3c
blob + 3b6200000b3462fc4fa34348605f411fe70b4896
--- regress/idset/idset_test.c
+++ regress/idset/idset_test.c
@@ -56,7 +56,7 @@ static const char *data1 = "data1", *data2 = "data2", 
 static int iter_count;
 
 static void
-idset_cb(struct got_object_id *id, void *data) {
+idset_cb(struct got_object_id *id, void *data, void *arg) {
 	if (iter_count == 0 &&
 	    (got_object_id_cmp(id, &id1) != 0 || data != (void *)data1))
 		abort();
@@ -182,7 +182,7 @@ idset_add_remove_iter(void)
 		goto done;
 	}
 
-	got_object_idset_for_each(set, idset_cb);
+	got_object_idset_for_each(set, idset_cb, NULL);
 done:
 	got_object_idset_free(set);
 	return (err == NULL);
blob - cb1a8b9ad8c0cdfaa8e2935293dc642426e29740
blob + 730e0f01dfd4ad3f3cda3fed246a8f6f65bf1b3b
--- tog/Makefile
+++ tog/Makefile
@@ -3,7 +3,7 @@
 PROG=		tog
 SRCS=		tog.c delta.c diff.c diffreg.c error.c fileindex.c object.c \
 		opentemp.c path.c pack.c privsep.c reference.c repository.c \
-		sha1.c worktree.c zbuf.c
+		sha1.c worktree.c zbuf.c object_idset.c commit_graph.c
 
 CPPFLAGS = -I${.CURDIR}/../include -I${.CURDIR}/../lib
 LDADD = -lpanel -lncursesw -lutil -lz