blob: cbcceab9d56b591ee851374c9030a23a4c65a462 [file] [log] [blame]
Steve Haslam837c8762008-07-25 18:51:51 +01001#!/bin/sh
2
3test_description=clone
4
5. ./test-lib.sh
6
7test_expect_success setup '
Elijah Newren771cf1d2010-10-03 14:00:08 -06008 echo "#!/bin/sh" > not_ssh &&
9 echo "echo \"\$*\" > not_ssh_output" >> not_ssh &&
10 echo "exit 1" >> not_ssh &&
Steve Haslam837c8762008-07-25 18:51:51 +010011 chmod +x not_ssh
12'
13
Nanako Shiraishi3604e7c2008-09-03 17:59:29 +090014test_expect_success 'clone calls git upload-pack unqualified with no -u option' '
David Tran512477b2014-03-18 18:54:05 +000015 test_must_fail env GIT_SSH=./not_ssh git clone localhost:/path/to/repo junk &&
Elijah Newren771cf1d2010-10-03 14:00:08 -060016 echo "localhost git-upload-pack '\''/path/to/repo'\''" >expected &&
Steve Haslam837c8762008-07-25 18:51:51 +010017 test_cmp expected not_ssh_output
18'
19
Nanako Shiraishi3604e7c2008-09-03 17:59:29 +090020test_expect_success 'clone calls specified git upload-pack with -u option' '
David Tran512477b2014-03-18 18:54:05 +000021 test_must_fail env GIT_SSH=./not_ssh \
22 git clone -u ./something/bin/git-upload-pack localhost:/path/to/repo junk &&
Elijah Newren771cf1d2010-10-03 14:00:08 -060023 echo "localhost ./something/bin/git-upload-pack '\''/path/to/repo'\''" >expected &&
Steve Haslam837c8762008-07-25 18:51:51 +010024 test_cmp expected not_ssh_output
25'
26
27test_done