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

[PATCH] Fix remote.<remote>.vcs

From
ILIlari Liusvaara <ilari.liusvaara@elisanet.fi>
Date
Jan 27, 2010, 16:16 UTC
Message-ID
<1264608977-20665-1-git-send-email-ilari.liusvaara@elisanet.fi>

remote.<remote>.vcs causes remote->foreign_vcs to be set on entry to transport_get(). Unfortunately, the code assumed that any such entry is stale from previous round. Resetting after starting the remote helper avoids that case (it isn't likely anyone is using VCS setting and multiple push URLs, as VCS setting is meant for non-URL-based helpers).

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
---
 transport.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

Tor, does this also fix the segfault for you? This might work without breaking some multiple-URL cases (just commenting out the reset will break them).

diff --git a/transport.c b/transport.c
index 7714fdb..76b22e5 100644
--- a/transport.c
+++ b/transport.c
@@ -923,9 +923,6 @@ struct transport *transport_get(struct remote *remote, const char *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;
@@ -938,6 +935,7 @@ struct transport *transport_get(struct remote *remote, const char *url)
 
 	if (remote && remote->foreign_vcs) {
 		transport_helper_init(ret, remote->foreign_vcs);
+		remote->foreign_vcs = NULL;
 	} else if (!prefixcmp(url, "rsync:")) {
 		ret->get_refs_list = get_refs_via_rsync;
 		ret->fetch = fetch_objs_via_rsync;
-- 
1.7.0.rc0.19.gd681a
Next: Sverre Rabbelier
Message 1 of 3 in “Fix remote.<remote>.vcs”
  1. Fix remote.<remote>.vcsIlari Liusvaara, Jan 27, 2010
  2. Sverre RabbelierJan 27, 2010
  3. Ilari LiusvaaraJan 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.