tests for sparse clone
PATCH 9/12 tests for sparse clone
Signed-off-by Nguyễn Thái Ngọc Duy <[email protected]>
--- t/t5703-clone-sparse.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) create mode 100755 t/t5703-clone-sparse.sh
t/t5703-clone-sparse.sh new file +40 -0
@@ -0,0 +1,40 @@ +#!/bin/sh + +test_description='sparse clone' + +. ./test-lib.sh + +test_expect_success setup ' + rm -fr .git && + test_create_repo src && + ( + cd src + mkdir -p work/sub/dir + touch untracked tracked modified added + touch work/untracked work/tracked work/modified work/added + git add tracked work/tracked + git add modified work/modified + git commit -m initial + ) + +' + +test_expect_success 'sparse clone incompatible with --bare' ' + rm -fr dst && + test_must_fail git clone --path=work --bare src dst +' + +test_expect_success 'sparse clone incompatible with --no-checkout' ' + rm -fr dst && + test_must_fail git clone --path=work -n src dst +' + +test_expect_success 'clone with --path' ' + rm -fr dst && + git clone --path=work src dst && + cd dst && + test work = "$(git rev-parse --show-sparse-prefix)" && + test -z "$(git ls-files | grep -v ^work/)" +' + +test_done
Signature · 1 line
1.5.5.GIT