Re: [PATCH 12/12] upload-pack: move pack_objects_hook to upload_pack_data

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

 



On Wed, May 27, 2020 at 06:47:42PM +0200, Christian Couder wrote:

> As we cleanup 'upload-pack.c' by using 'struct upload_pack_data'
> more thoroughly, let's move the 'pack_objects_hook' static
> variable into this struct.
> 
> It is used by code common to protocol v0 and protocol v2.
> 
> While at it let's also free() it in upload_pack_data_clear().

Makes sense.

> @@ -133,6 +134,8 @@ static void upload_pack_data_clear(struct upload_pack_data *data)
>  	object_array_clear(&data->shallows);
>  	string_list_clear(&data->deepen_not, 0);
>  	list_objects_filter_release(&data->filter_options);
> +
> +	free((char *)data->pack_objects_hook);

This cast is ugly, but unavoidable because git_config_string() takes a
pointer-to-const.

-Peff



[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