Merge branch 'maint-1.5.5' into maint
[git] / t / t5601-clone.sh
1 #!/bin/sh
2
3 test_description=clone
4
5 . ./test-lib.sh
6
7 test_expect_success setup '
8
9         rm -fr .git &&
10         test_create_repo src &&
11         (
12                 cd src
13                 >file
14                 git add file
15                 git commit -m initial
16         )
17
18 '
19
20 test_expect_success 'clone with excess parameters' '
21
22         test_must_fail git clone -n "file://$(pwd)/src" dst junk
23
24 '
25
26 test_expect_success 'clone checks out files' '
27
28         git clone src dst &&
29         test -f dst/file
30
31 '
32
33 test_expect_success 'clone respects GIT_WORK_TREE' '
34
35         GIT_WORK_TREE=worktree git clone src bare &&
36         test -f bare/config &&
37         test -f worktree/file
38
39 '
40
41 test_expect_success 'clone creates intermediate directories' '
42
43         git clone src long/path/to/dst &&
44         test -f long/path/to/dst/file
45
46 '
47
48 test_expect_success 'clone creates intermediate directories for bare repo' '
49
50         git clone --bare src long/path/to/bare/dst &&
51         test -f long/path/to/bare/dst/config
52
53 '
54
55 test_done