git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 09/12] tests for sparse clone

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Jul 23, 2008, 14:57 UTC
Message-ID
<20080723145728.GA29144@laptop>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 t/t5703-clone-sparse.sh |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)
 create mode 100755 t/t5703-clone-sparse.sh
diff --git a/t/t5703-clone-sparse.sh b/t/t5703-clone-sparse.sh
new file mode 100755
index 0000000..012ead0
--- /dev/null
+++ b/t/t5703-clone-sparse.sh
@@ -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
-- 
1.5.5.GIT
Message 1 of 1 in “tests for sparse clone”
  1. 09/12 tests for sparse cloneNguyễn Thái Ngọc Duy, Jul 23, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.