Thread (67 messages) 67 messages, 6 authors, 2021-10-01

Re: [PATCH v2 8/8] builtin/repack.c: pass `--refs-snapshot` when writing bitmaps

flat view

From: Jonathan Tan <hidden>
Date: 2021-09-24 18:22:52

quoted hunk ↗ jump to hunk
+static void midx_snapshot_refs(struct tempfile *f)
+{
+	struct midx_snapshot_ref_data data;
+	const struct string_list *preferred = bitmap_preferred_tips(the_repository);
+
+	data.f = f;
+	oidset_init(&data.seen, 0);
+
+	if (!fdopen_tempfile(f, "w"))
+		 die(_("could not open tempfile %s for writing"),
+		     get_tempfile_path(f));
+
+	if (preferred) {
+		struct string_list_item *item;
+
+		data.preferred = 1;
+		for_each_string_list_item(item, preferred)
+			for_each_ref_in(item->string, midx_snapshot_ref_one, &data);
+		data.preferred = 0;
+	}
+
+	for_each_ref(midx_snapshot_ref_one, &data);
One small thing here - I think "data.preferred = 0;" needs to be moved
to right above this for_each_ref line. As it is, if preferred is NULL,
data.preferred wouldn't be initialized.

Other than that (and the minor changes I've suggested in previous
patches), this series looks good to me.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help