#!/bin/sh global test_description := 'clone' source ./test-lib.sh test_expect_success setup ' echo "#!/bin/sh" > not_ssh && echo "echo \"\$*\" > not_ssh_output" >> not_ssh && echo "exit 1" >> not_ssh && chmod +x not_ssh ' test_expect_success 'clone calls git upload-pack unqualified with no -u option' ' test_must_fail env GIT_SSH=./not_ssh git clone localhost:/path/to/repo junk && echo "localhost git-upload-pack '''''/path/to/repo'''''" >expected && test_cmp expected not_ssh_output ' test_expect_success 'clone calls specified git upload-pack with -u option' ' test_must_fail env GIT_SSH=./not_ssh \ git clone -u ./something/bin/git-upload-pack localhost:/path/to/repo junk && echo "localhost ./something/bin/git-upload-pack '''''/path/to/repo'''''" >expected && test_cmp expected not_ssh_output ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:test_description) op:Equal rhs:{(clone)} spids:[4])] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ <"\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"> ) } ) (C {(test_expect_success)} {(SQ <"clone calls git upload-pack unqualified with no -u option">)} { (SQ <"\n"> <"\ttest_must_fail env GIT_SSH=./not_ssh git clone localhost:/path/to/repo junk &&\n"> <"\techo \"localhost git-upload-pack "> ) (EscapedLiteralPart token:) (SQ ) (EscapedLiteralPart token:) (SQ <"\" >expected &&\n"> <"\ttest_cmp expected not_ssh_output\n">) } ) (C {(test_expect_success)} {(SQ <"clone calls specified git upload-pack with -u option">)} { (SQ <"\n"> <"\ttest_must_fail env GIT_SSH=./not_ssh \\\n"> <"\t\tgit clone -u ./something/bin/git-upload-pack localhost:/path/to/repo junk &&\n"> <"\techo \"localhost ./something/bin/git-upload-pack "> ) (EscapedLiteralPart token:) (SQ ) (EscapedLiteralPart token:) (SQ <"\" >expected &&\n"> <"\ttest_cmp expected not_ssh_output\n">) } ) (C {(test_done)}) ] )