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

[PATCH 3/3] buitin-status: Add tests for submodule summary

From
Ping Yin <pkufranky@gmail.com>
Date
Mar 12, 2008, 02:21 UTC
Message-ID
<1205288512-20435-3-git-send-email-pkufranky@gmail.com>
In-Reply-To
<1205288512-20435-2-git-send-email-pkufranky@gmail.com>
---
 t/t7502-status.sh |   76 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 76 insertions(+), 0 deletions(-)
diff --git a/t/t7502-status.sh b/t/t7502-status.sh
index e006074..d48c0fe 100755
--- a/t/t7502-status.sh
+++ b/t/t7502-status.sh
@@ -149,4 +149,80 @@ test_expect_success 'status of partial commit excluding new file in index' '
 	diff -u expect output
 '
 
+test_expect_success "setup status submodule summary" '
+	test_create_repo sm &&
+	cd sm &&
+	: >foo &&
+	git add foo &&
+	git commit -m "Add foo" &&
+	cd .. &&
+	git add sm
+'
+
+cat > expect << \EOF
+# On branch master
+# Changes to be committed:
+#   (use "git reset HEAD <file>..." to unstage)
+#
+#	new file:   dir2/added
+#	new file:   sm
+#
+# Changed but not updated:
+#   (use "git add <file>..." to update what will be committed)
+#
+#	modified:   dir1/modified
+#
+# Untracked files:
+#   (use "git add <file>..." to include in what will be committed)
+#
+#	dir1/untracked
+#	dir2/modified
+#	dir2/untracked
+#	expect
+#	output
+#	untracked
+EOF
+test_expect_success "status submodule summary is disabled by default" '
+	git status > output &&
+	git diff expect output
+'
+
+cd sm &&
+head=$(git rev-parse --verify HEAD | cut -c1-7) &&
+cd ..
+
+cat > expect <<-EOF
+# On branch master
+# Changes to be committed:
+#   (use "git reset HEAD <file>..." to unstage)
+#
+#	new file:   dir2/added
+#	new file:   sm
+#
+# Changed but not updated:
+#   (use "git add <file>..." to update what will be committed)
+#
+#	modified:   dir1/modified
+#
+# Modified submodules:
+#
+# * sm 0000000...$head (1):
+#   > Add foo
+#
+# Untracked files:
+#   (use "git add <file>..." to include in what will be committed)
+#
+#	dir1/untracked
+#	dir2/modified
+#	dir2/untracked
+#	expect
+#	output
+#	untracked
+EOF
+test_expect_success "status submodule summary" '
+	git config status.submodulesummary 10 &&
+	git status > output &&
+	git diff expect output
+'
+
 test_done
-- 
1.5.4.3.347.g5314c
Previous: Ping YinNext: Johannes Sixt
Message 3 of 6 in “builtin-status: submodule summary support”
  1. 1/3 builtin-status: submodule summary supportPing Yin, Mar 12, 2008
  2. 2/3 builtin-status: configurable submodule summary sizePing Yin, Mar 12, 2008
  3. 3/3 buitin-status: Add tests for submodule summaryPing Yin, Mar 12, 2008
  4. Johannes SixtMar 12, 2008
  5. Johannes SixtMar 12, 2008
  6. Ping YinMar 13, 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.