git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] Fix remote.<remote>.vcs

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 27, 2010, 19:13 UTC
Message-ID
<7vaavzqs2q.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.LNX.2.00.1001271335140.14365@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
> Except that you missed the "remote == NULL" case (noted below), this is 
> what I was thinking of.
>
> Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Show 8 quoted lines
>>  	if (!remote)
>>  		die("No remote provided to transport_get()");
>>  
>>  	ret->remote = remote;
>> +	helper = remote->foreign_vcs;
>
> Needs to be "helper = remote ? remote->foreign_vcs : NULL", for the same 
> reason that the test below had been "remote && remote->foreign_vcs".

Even in the presense of "if remote is NULL then we die" in the context above?

Show 30 quoted lines
>>  
>>  	if (!url && remote && remote->url)
>>  		url = remote->url[0];
>>  	ret->url = url;
>>  
>> -	/* In case previous URL had helper forced, reset it. */
>> -	remote->foreign_vcs = NULL;
>> -
>>  	/* maybe it is a foreign URL? */
>>  	if (url) {
>>  		const char *p = url;
>> @@ -933,11 +932,11 @@ struct transport *transport_get(struct remote *remote, const char *url)
>>  		while (isalnum(*p))
>>  			p++;
>>  		if (!prefixcmp(p, "::"))
>> -			remote->foreign_vcs = xstrndup(url, p - url);
>> +			helper = xstrndup(url, p - url);
>>  	}
>>  
>> -	if (remote && remote->foreign_vcs) {
>> -		transport_helper_init(ret, remote->foreign_vcs);
>> +	if (helper) {
>> +		transport_helper_init(ret, helper);
>>  	} else if (!prefixcmp(url, "rsync:")) {
>>  		ret->get_refs_list = get_refs_via_rsync;
>>  		ret->fetch = fetch_objs_via_rsync;
>> -- 
>> 1.7.0.rc0.19.gb557e6
>> 
>> 
Previous: Daniel Barkalow
Message 7 of 7 in “Fix remote.<remote>.vcs”
  1. Fix remote.<remote>.vcsIlari Liusvaara, Jan 27, 2010
  2. Sverre RabbelierJan 27, 2010
  3. Daniel BarkalowJan 27, 2010
  4. Ilari LiusvaaraJan 27, 2010
  5. Junio C HamanoJan 27, 2010
  6. Daniel BarkalowJan 27, 2010
  7. Junio C HamanoJan 27, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.