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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +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.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux