Propagate -u/--upload-pack option of "git clone" to transport.
The -u option to override the remote system's path to git-upload-pack was being ignored by "git clone"; caused by a missing call to transport_set_option to set TRANS_OPT_UPLOADPACK. Presumably this crept in when git-clone was converted from shell to C. Signed-off-by: Steve Haslam <shaslam@lastminute.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Steve Haslam committed
Jul 25, 2008 at 18:51 UTC
31f4e768a4b53419a1de9c4006c7b3747fc356eb
2 files changed
+30
builtin-clone.c
+4
@@ -473,6 +473,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
473
if (option_quiet)
474
transport->verbose = -1;
475
476
+ if (option_upload_pack)
477
+ transport_set_option(transport, TRANS_OPT_UPLOADPACK,
478
+ option_upload_pack);
479
+
480
refs = transport_get_remote_refs(transport);
481
transport_fetch_refs(transport, refs);
482
}
t/t5602-clone-remote-exec.sh
new
+26
@@ -0,0 +1,26 @@
1
+#!/bin/sh
2
+
3
+test_description=clone
4
+
5
+. ./test-lib.sh
6
+
7
+test_expect_success setup '
8
+ echo "#!/bin/sh" > not_ssh
9
+ echo "echo \"\$*\" > not_ssh_output" >> not_ssh
10
+ echo "exit 1" >> not_ssh
11
+ chmod +x not_ssh
12
+'
13
+
14
+test_expect_success 'clone calls git-upload-pack unqualified with no -u option' '
15
+ GIT_SSH=./not_ssh git clone localhost:/path/to/repo junk
16
+ echo "localhost git-upload-pack '\''/path/to/repo'\''" >expected
17
+ test_cmp expected not_ssh_output
18
+'
19
+
20
+test_expect_success 'clone calls specified git-upload-pack with -u option' '
21
+ GIT_SSH=./not_ssh git clone -u /something/bin/git-upload-pack localhost:/path/to/repo junk
22
+ echo "localhost /something/bin/git-upload-pack '\''/path/to/repo'\''" >expected
23
+ test_cmp expected not_ssh_output
24
+'
25
+
26
+test_done