Fix clone to setup the origin if its name ends with .git
[git/gitweb.git] / t / t5701-clone-local.sh
blobb0933274db4ee73341bcc55e7d98fcddc3bae920
1 #!/bin/sh
3 test_description='test local clone'
4 . ./test-lib.sh
6 D=`pwd`
8 test_expect_success 'preparing origin repository' '
9 : >file && git add . && git commit -m1 &&
10 git clone --bare . a.git &&
11 git clone --bare . x
14 test_expect_success 'local clone without .git suffix' '
15 cd "$D" &&
16 git clone -l -s a b &&
17 cd b &&
18 git fetch
21 test_expect_success 'local clone with .git suffix' '
22 cd "$D" &&
23 git clone -l -s a.git c &&
24 cd c &&
25 git fetch
28 test_expect_success 'local clone from x' '
29 cd "$D" &&
30 git clone -l -s x y &&
31 cd y &&
32 git fetch
35 test_expect_success 'local clone from x.git that does not exist' '
36 cd "$D" &&
37 if git clone -l -s x.git z
38 then
39 echo "Oops, should have failed"
40 false
41 else
42 echo happy
46 test_done