Steve Haslam | 837c876 | 2008-07-25 18:51:51 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description=clone |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
| 7 | test_expect_success setup ' |
Elijah Newren | 771cf1d | 2010-10-03 14:00:08 -0600 | [diff] [blame] | 8 | echo "#!/bin/sh" > not_ssh && |
| 9 | echo "echo \"\$*\" > not_ssh_output" >> not_ssh && |
| 10 | echo "exit 1" >> not_ssh && |
Steve Haslam | 837c876 | 2008-07-25 18:51:51 +0100 | [diff] [blame] | 11 | chmod +x not_ssh |
| 12 | ' |
| 13 | |
Nanako Shiraishi | 3604e7c | 2008-09-03 17:59:29 +0900 | [diff] [blame] | 14 | test_expect_success 'clone calls git upload-pack unqualified with no -u option' ' |
David Tran | 512477b | 2014-03-18 18:54:05 +0000 | [diff] [blame] | 15 | test_must_fail env GIT_SSH=./not_ssh git clone localhost:/path/to/repo junk && |
Elijah Newren | 771cf1d | 2010-10-03 14:00:08 -0600 | [diff] [blame] | 16 | echo "localhost git-upload-pack '\''/path/to/repo'\''" >expected && |
Steve Haslam | 837c876 | 2008-07-25 18:51:51 +0100 | [diff] [blame] | 17 | test_cmp expected not_ssh_output |
| 18 | ' |
| 19 | |
Nanako Shiraishi | 3604e7c | 2008-09-03 17:59:29 +0900 | [diff] [blame] | 20 | test_expect_success 'clone calls specified git upload-pack with -u option' ' |
David Tran | 512477b | 2014-03-18 18:54:05 +0000 | [diff] [blame] | 21 | test_must_fail env GIT_SSH=./not_ssh \ |
| 22 | git clone -u ./something/bin/git-upload-pack localhost:/path/to/repo junk && |
Elijah Newren | 771cf1d | 2010-10-03 14:00:08 -0600 | [diff] [blame] | 23 | echo "localhost ./something/bin/git-upload-pack '\''/path/to/repo'\''" >expected && |
Steve Haslam | 837c876 | 2008-07-25 18:51:51 +0100 | [diff] [blame] | 24 | test_cmp expected not_ssh_output |
| 25 | ' |
| 26 | |
| 27 | test_done |