{"thread":{"id":"14677","subject":"[PATCH] Propagate -u/--upload-pack option of \"git clone\" to transport.","startedAt":"2008-07-25T17:51:51Z","lastAt":"2008-07-25T21:48:01Z","messageCount":2,"participants":["Steve Haslam","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"84913","messageId":"1217008311-27916-1-git-send-email-shaslam@lastminute.com","threadId":"14677","inReplyTo":null,"subject":"[PATCH] Propagate -u/--upload-pack option of \"git clone\" to transport.","fromName":"Steve Haslam","fromEmail":"shaslam@lastminute.com","sentAt":"2008-07-25T17:51:51Z","receivedAt":"2008-07-25T17:51:51Z","isPatch":true,"sender":{"key":"shaslam@lastminute.com","avatar":"https://gravatar.com/avatar/df44c553ba2fa56f01414f0c0873212d6f8506f3426586238271bac83fde2edf?d=mp&s=160"},"body":"The -u option to override the remote system's path to git-upload-pack was\nbeing ignored by \"git clone\"; caused by a missing call to\ntransport_set_option to set TRANS_OPT_UPLOADPACK. Presumably this crept in\nwhen git-clone was converted from shell to C.\n\nSigned-off-by: Steve Haslam <shaslam@lastminute.com>\n---\n builtin-clone.c              |    4 ++++\n t/t5602-clone-remote-exec.sh |   26 ++++++++++++++++++++++++++\n 2 files changed, 30 insertions(+), 0 deletions(-)\n create mode 100755 t/t5602-clone-remote-exec.sh\n\ndiff --git a/builtin-clone.c b/builtin-clone.c\nindex 3522245..e086a40 100644\n--- a/builtin-clone.c\n+++ b/builtin-clone.c\n@@ -480,6 +480,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\tif (option_quiet)\n \t\t\ttransport->verbose = -1;\n \n+\t\tif (option_upload_pack)\n+\t\t\ttransport_set_option(transport, TRANS_OPT_UPLOADPACK,\n+\t\t\t\t\t     option_upload_pack);\n+\n \t\trefs = transport_get_remote_refs(transport);\n \t\ttransport_fetch_refs(transport, refs);\n \t}\ndiff --git a/t/t5602-clone-remote-exec.sh b/t/t5602-clone-remote-exec.sh\nnew file mode 100755\nindex 0000000..8367a68\n--- /dev/null\n+++ b/t/t5602-clone-remote-exec.sh\n@@ -0,0 +1,26 @@\n+#!/bin/sh\n+\n+test_description=clone\n+\n+. ./test-lib.sh\n+\n+test_expect_success setup '\n+\techo \"#!/bin/sh\" > not_ssh\n+\techo \"echo \\\"\\$*\\\" > not_ssh_output\" >> not_ssh\n+\techo \"exit 1\" >> not_ssh\n+\tchmod +x not_ssh\n+'\n+\n+test_expect_success 'clone calls git-upload-pack unqualified with no -u option' '\n+\tGIT_SSH=./not_ssh git clone localhost:/path/to/repo junk\n+\techo \"localhost git-upload-pack '\\''/path/to/repo'\\''\" >expected\n+\ttest_cmp expected not_ssh_output\n+'\n+\n+test_expect_success 'clone calls specified git-upload-pack with -u option' '\n+\tGIT_SSH=./not_ssh git clone -u /something/bin/git-upload-pack localhost:/path/to/repo junk\n+\techo \"localhost /something/bin/git-upload-pack '\\''/path/to/repo'\\''\" >expected\n+\ttest_cmp expected not_ssh_output\n+'\n+\n+test_done\n-- \n1.6.0.rc0.43.g1cd6\n"},{"id":"84956","messageId":"7vsktxr5ym.fsf@gitster.siamese.dyndns.org","threadId":"14677","inReplyTo":"1217008311-27916-1-git-send-email-shaslam@lastminute.com","subject":"Re: [PATCH] Propagate -u/--upload-pack option of \"git clone\" to transport.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-25T21:48:01Z","receivedAt":"2008-07-25T21:48:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Looks correct; thanks.  \n"}]}