Re: [PATCH v2 6/7] promisor-remote: lazy-fetch objects in subprocess

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

 



Jonathan Tan <jonathantanmy@xxxxxxxxxx> writes:

> Teach Git to lazy-fetch missing objects in a subprocess instead of doing
> it in-process. This allows any fatal errors that occur during the fetch
> to be isolated and converted into an error return value, instead of
> causing the current command being run to terminate.
>
> ...
>  static int fetch_objects(const char *remote_name,
>  			 const struct object_id *oids,
>  			 int oid_nr)
>  {
> -	struct ref *ref = NULL;
> +	struct child_process child = CHILD_PROCESS_INIT;
>  	int i;
> +	FILE *child_in;
> +
> +	child.git_cmd = 1;
> +	child.in = -1;
> +	argv_array_pushl(&child.args, "-c", "fetch.negotiationAlgorithm=null",
> +			 "fetch", remote_name, "--no-tags",
> +			 "--no-write-fetch-head", "--recurse-submodules=no",
> +			 "--filter=blob:none", "--stdin", NULL);

Finally we get to use the new negotiator introduced earlier.  Nice.

> +	if (start_command(&child))
> +		die(_("promisor-remote: unable to fork off fetch subprocess"));
> +	child_in = xfdopen(child.in, "w");



[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