diff options
Diffstat (limited to 't/t5601-clone.sh')
| -rwxr-xr-x | t/t5601-clone.sh | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh new file mode 100755 index 0000000000..b642fb260b --- /dev/null +++ b/t/t5601-clone.sh @@ -0,0 +1,55 @@ +#!/bin/sh + +test_description=clone + +. ./test-lib.sh + +test_expect_success setup ' + + rm -fr .git && + test_create_repo src && + ( + cd src + >file + git add file + git commit -m initial + ) + +' + +test_expect_success 'clone with excess parameters' ' + + test_must_fail git clone -n "file://$(pwd)/src" dst junk + +' + +test_expect_success 'clone checks out files' ' + + git clone src dst && + test -f dst/file + +' + +test_expect_success 'clone respects GIT_WORK_TREE' ' + + GIT_WORK_TREE=worktree git clone src bare && + test -f bare/config && + test -f worktree/file + +' + +test_expect_success 'clone creates intermediate directories' ' + + git clone src long/path/to/dst && + test -f long/path/to/dst/file + +' + +test_expect_success 'clone creates intermediate directories for bare repo' ' + + git clone --bare src long/path/to/bare/dst && + test -f long/path/to/bare/dst/config + +' + +test_done |
