Skip to content

Commit 27a557a

Browse files
Ilari Liusvaaragitster
authored andcommitted
Reset possible helper before reusing remote structure
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 28ca0c9 commit 27a557a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

transport.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,9 @@ struct transport *transport_get(struct remote *remote, const char *url)
875875
url = remote->url[0];
876876
ret->url = url;
877877

878+
/* In case previous URL had helper forced, reset it. */
879+
remote->foreign_vcs = NULL;
880+
878881
/* maybe it is a foreign URL? */
879882
if (url) {
880883
const char *p = url;

0 commit comments

Comments
 (0)