Skip to content

Commit

Permalink
Reset possible helper before reusing remote structure
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ilari Liusvaara authored and Junio C Hamano committed Jan 10, 2010
1 parent 28ca0c9 commit 27a557a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 27a557a

Please sign in to comment.