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

[BUGFIX] Reset possible helper before reusing remote structure

From
ILIlari Liusvaara <ilari.liusvaara@elisanet.fi>
Date
Jan 9, 2010, 17:28 UTC
Message-ID
<1263058092-20501-1-git-send-email-ilari.liusvaara@elisanet.fi>

If one had multiple URLs configured for remote with previous one having forced helper but the subsequent one not, like:

url = foo::bar://baz url = ssh://example/example.git

Then the subsequent URL is passed to foo helper, which isn't correct. Fix it to be parsed normally by resetting foreign VCS name before parsing the URL protocol.

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
---
 transport.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/transport.c b/transport.c
index 97bb5e6..669bc85 100644
--- a/transport.c
+++ b/transport.c
@@ -875,6 +875,9 @@ 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;
-- 
1.6.6.3.gaa2e1
Message 1 of 1 in “[BUGFIX] Reset possible helper before reusing remote structure”
  1. Ilari LiusvaaraJan 9, 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.