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

[PATCH 17/17] Add narrow clone demonstration test

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Sep 5, 2010, 06:47 UTC
Message-ID
<1283669264-15759-18-git-send-email-pclouds@gmail.com>
In-Reply-To
<1283669264-15759-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 t/t9999-narrow.sh |   87 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 87 insertions(+), 0 deletions(-)
 create mode 100755 t/t9999-narrow.sh
diff --git a/t/t9999-narrow.sh b/t/t9999-narrow.sh
new file mode 100755
index 0000000..2974ddc
--- /dev/null
+++ b/t/t9999-narrow.sh
@@ -0,0 +1,87 @@
+#!/bin/sh
+
+test_description='narrow misc tests'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+	git clone --mirror ../../.git src.git
+'
+
+test_expect_success clone '
+	git clone --depth=50 --narrow=Documentation --narrow=block-sha1 file://"`pwd`"/src.git dst &&
+	test -f dst/Documentation/git.txt &&
+	test -f dst/block-sha1/sha1.c &&
+	! test -f git.c
+'
+
+test_expect_success 'into dst' '
+	cd dst
+'
+
+#test_expect_failure 'fsck' 'git fsck'
+
+test_expect_success 'checkout -b ' '
+	git checkout -b mybranch
+'
+
+test_expect_success 'log' '
+	git log --stat HEAD~20.. >/dev/null
+'
+
+test_expect_success 'modify worktree' '
+	echo 1 >>Documentation/git.txt
+'
+
+test_expect_success 'diff' '
+	git diff
+'
+
+test_expect_success 'diff HEAD' '
+	git diff HEAD
+'
+
+test_expect_success 'diff --cached' '
+	git add Documentation/git.txt &&
+	git diff --cached
+'
+
+test_expect_success 'commit' '
+	git commit -a -m 1 &&
+	git tag branch0 &&
+	echo 2 >>block-sha1/sha1.c &&
+	git commit -a -m 2 &&
+	echo 3 >>Documentation/git.txt &&
+	echo 3 >>block-sha1/sha1.c &&
+	git commit -a -m 3 &&
+	git tag branch1
+'
+
+test_expect_success 'internal merge' '
+	git checkout branch0 &&
+	echo 4 >>block-sha1/sha1.h &&
+	git commit -a -m 4 && false
+	git tag branch2 &&
+	git merge branch1 &&
+	grep "^2$" block-sha1/sha1.c &&
+	git tag merge1.2
+'
+
+test_expect_success 'rebase' '
+	git checkout branch1 &&
+	git rebase --onto branch2 branch0
+'
+
+test_expect_success 'push' '
+	git push ../src.git +merge1.2:refs/heads/mybranch &&
+	git rev-parse merge1.2 >../expected &&
+	(
+		cd ../src.git &&
+		git rev-parse mybranch >result &&
+		test_cmp ../expected result &&
+		echo fscking... &&
+		git fsck --no-full
+	)
+'
+
+test_done
-- 
1.7.1.rc1.69.g24c2f7
Previous: Nguyễn Thái Ngọc DuyNext: Sverre Rabbelier
Message 18 of 25 in “Narrow clone v3 (was subtree clone)”
  1. 00/17 Narrow clone v3 (was subtree clone)Nguyễn Thái Ngọc Duy, Sep 5, 2010
  2. 01/17 rev-list: do not do commit simplification if simplify_history = 0Nguyễn Thái Ngọc Duy, Sep 5, 2010
  3. 02/17 tree.c: add path_to_sha1()Nguyễn Thái Ngọc Duy, Sep 5, 2010
  4. 03/17 Introduce $GIT_DIR/narrowNguyễn Thái Ngọc Duy, Sep 5, 2010
  5. 04/17 index: make narrow index incompatible with older gitNguyễn Thái Ngọc Duy, Sep 5, 2010
  6. 05/17 pack-objects: support narrow packs with pathspecsNguyễn Thái Ngọc Duy, Sep 5, 2010
  7. 06/17 {fetch,upload}-pack: support narrow repositoryNguyễn Thái Ngọc Duy, Sep 5, 2010
  8. 07/17 unpack-trees: split traverse_trees() code into a separate functionNguyễn Thái Ngọc Duy, Sep 5, 2010
  9. 08/17 unpack-trees: support unpack trees in narrow repositoryNguyễn Thái Ngọc Duy, Sep 5, 2010
  10. 09/17 cache-tree: only cache tree within narrow areaNguyễn Thái Ngọc Duy, Sep 5, 2010
  11. 10/17 get_pathspec(): support narrow pathspec rewritingNguyễn Thái Ngọc Duy, Sep 5, 2010
  12. 11/17 pathspec retrieval fixNguyễn Thái Ngọc Duy, Sep 5, 2010
  13. 12/17 clone: support --narrow optionNguyễn Thái Ngọc Duy, Sep 5, 2010
  14. 13/17 commit: add narrow's commit_tree versionNguyễn Thái Ngọc Duy, Sep 5, 2010
  15. 14/17 commit: use commit_narrow_tree() to support narrow repoNguyễn Thái Ngọc Duy, Sep 5, 2010
  16. 15/17 write-tree: requires --narrow-base in narrow repositoryNguyễn Thái Ngọc Duy, Sep 5, 2010
  17. 16/17 merge: try to do local merge if possible in narrow repoNguyễn Thái Ngọc Duy, Sep 5, 2010
  18. 17/17 Add narrow clone demonstration testNguyễn Thái Ngọc Duy, Sep 5, 2010
  19. Sverre RabbelierSep 5, 2010
  20. Nguyen Thai Ngoc DuySep 5, 2010
  21. Elijah NewrenSep 5, 2010
  22. Elijah NewrenSep 6, 2010
  23. Nguyen Thai Ngoc DuySep 6, 2010
  24. Sverre RabbelierSep 6, 2010
  25. Elijah NewrenSep 6, 2010

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.