bash completion: Add completion for 'git archive'
[git/spearce.git] / t / t5601-clone.sh
bloba13b6f9d3d9c0735ce87c82150283727fab8e378
1 #!/bin/sh
3 test_description=clone
5 . ./test-lib.sh
7 test_expect_success setup '
9 rm -fr .git &&
10 test_create_repo src &&
12 cd src
13 >file
14 git add file
15 git commit -m initial
20 test_expect_success 'clone with excess parameters (1)' '
22 rm -fr dst &&
23 test_must_fail git clone -n src dst junk
27 test_expect_success 'clone with excess parameters (2)' '
29 rm -fr dst &&
30 test_must_fail git clone -n "file://$(pwd)/src" dst junk
34 test_expect_success 'output from clone' '
35 rm -fr dst &&
36 git clone -n "file://$(pwd)/src" dst >output &&
37 test $(grep Initialized output | wc -l) = 1
40 test_expect_success 'clone does not keep pack' '
42 rm -fr dst &&
43 git clone -n "file://$(pwd)/src" dst &&
44 ! test -f dst/file &&
45 ! (echo dst/.git/objects/pack/pack-* | grep "\.keep")
49 test_expect_success 'clone checks out files' '
51 rm -fr dst &&
52 git clone src dst &&
53 test -f dst/file
57 test_expect_success 'clone respects GIT_WORK_TREE' '
59 GIT_WORK_TREE=worktree git clone src bare &&
60 test -f bare/config &&
61 test -f worktree/file
65 test_expect_success 'clone creates intermediate directories' '
67 git clone src long/path/to/dst &&
68 test -f long/path/to/dst/file
72 test_expect_success 'clone creates intermediate directories for bare repo' '
74 git clone --bare src long/path/to/bare/dst &&
75 test -f long/path/to/bare/dst/config
79 test_expect_success 'clone --mirror' '
81 git clone --mirror src mirror &&
82 test -f mirror/HEAD &&
83 test ! -f mirror/file &&
84 FETCH="$(cd mirror && git config remote.origin.fetch)" &&
85 test "+refs/*:refs/*" = "$FETCH" &&
86 MIRROR="$(cd mirror && git config --bool remote.origin.mirror)" &&
87 test "$MIRROR" = true
91 test_expect_success 'clone --bare names the local repository <name>.git' '
93 git clone --bare src &&
94 test -d src.git
98 test_done