Correct name of diff_flush() in API documentation
[git/platforms/storm.git] / t / t5701-clone-local.sh
blob59a165a6d44190a1ce9ef9575dc6c8a2ce9f4efb
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 &&
12 test "$(GIT_CONFIG=a.git/config git config --bool core.bare)" = true &&
13 test "$(GIT_CONFIG=x/config git config --bool core.bare)" = true
16 test_expect_success 'local clone without .git suffix' '
17 cd "$D" &&
18 git clone -l -s a b &&
19 cd b &&
20 test "$(GIT_CONFIG=.git/config git config --bool core.bare)" = false &&
21 git fetch
24 test_expect_success 'local clone with .git suffix' '
25 cd "$D" &&
26 git clone -l -s a.git c &&
27 cd c &&
28 git fetch
31 test_expect_success 'local clone from x' '
32 cd "$D" &&
33 git clone -l -s x y &&
34 cd y &&
35 git fetch
38 test_expect_success 'local clone from x.git that does not exist' '
39 cd "$D" &&
40 if git clone -l -s x.git z
41 then
42 echo "Oops, should have failed"
43 false
44 else
45 echo happy
49 test_expect_success 'With -no-hardlinks, local will make a copy' '
50 cd "$D" &&
51 git clone --bare --no-hardlinks x w &&
52 cd w &&
53 linked=$(find objects -type f ! -links 1 | wc -l) &&
54 test 0 = $linked
57 test_expect_success 'Even without -l, local will make a hardlink' '
58 cd "$D" &&
59 rm -fr w &&
60 git clone -l --bare x w &&
61 cd w &&
62 copied=$(find objects -type f -links 1 | wc -l) &&
63 test 0 = $copied
66 test_expect_success 'local clone of repo with nonexistent ref in HEAD' '
67 cd "$D" &&
68 echo "ref: refs/heads/nonexistent" > a.git/HEAD &&
69 git clone a d &&
70 cd d &&
71 git fetch &&
72 test ! -e .git/refs/remotes/origin/HEAD'
74 test_done