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

[PATCH 3/3] Add tests for the contextual initial status message

From
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Date
Jun 20, 2017, 03:02 UTC
Message-ID
<20170620030220.7323-3-kaarticsivaraam91196@gmail.com>
In-Reply-To
<20170620030220.7323-1-kaarticsivaraam91196@gmail.com>
Also, fixed minor spacing issue
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
---
 t/t7508-status.sh | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index fb00e6d9b..6cf3af9d9 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -1494,9 +1494,39 @@ EOF
 test_expect_success 'git commit -m will commit a staged but ignored submodule' '
 	git commit -uno -m message &&
 	git status -s --ignore-submodules=dirty >output &&
-	 test_i18ngrep ! "^M. sm" output &&
+	test_i18ngrep ! "^M. sm" output &&
 	git config --remove-section submodule.subname &&
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
+test_expect_success '"No commits yet" should be noted in status output' '
+	git checkout --orphan empty-branch-1 &&
+	git status >output &&
+	test_i18ngrep "No commits yet" output
+'
+
+test_expect_success '"No commits yet" should not be noted in status output' '
+	git checkout --orphan empty-branch-2 &&
+	test_commit test-commit-1 &&
+	git status >output &&
+	test_i18ngrep ! "No commits yet" output
+'
+
+test_expect_success '"Initial commit" should be noted in commit template' '
+	git checkout --orphan empty-branch-3 &&
+	touch to_be_committed_1 &&
+	git add to_be_committed_1 &&
+	git commit --dry-run >output &&
+	test_i18ngrep "Initial commit" output
+'
+
+test_expect_success '"Initial commit" should not be noted in commit template' '
+	git checkout --orphan empty-branch-4 &&
+	test_commit test-commit-2 &&
+	touch to_be_committed_2 &&
+	git add to_be_committed_2 &&
+	git commit --dry-run >output &&
+	test_i18ngrep ! "Initial commit" output
+'
+
 test_done
-- 
2.11.0
Previous: Kaartic SivaraamNext: Ævar Arnfjörð Bjarmason
Message 35 of 48 in “wt-status.c: Modified status message shown for a parent-less branch”
  1. wt-status.c: Modified status message shown for a parent-less branchKaartic Sivaraam, Jun 10, 2017
  2. Kaartic SivaraamJun 10, 2017
  3. Junio C HamanoJun 10, 2017
  4. Kaartic SivaraamJun 10, 2017
  5. Kaartic SivaraamJun 10, 2017
  6. Jeff KingJun 10, 2017
  7. Junio C HamanoJun 10, 2017
  8. Kaartic SivaraamJun 12, 2017
  9. Junio C HamanoJun 12, 2017
  10. Jeff KingJun 12, 2017
  11. Junio C HamanoJun 12, 2017
  12. Jeff KingJun 12, 2017
  13. Kaartic SivaraamJun 15, 2017
  14. Jeff KingJun 15, 2017
  15. Samuel LijinJun 15, 2017
  16. Jeff KingJun 15, 2017
  17. Kaartic SivaraamJun 16, 2017
  18. Jeff KingJun 16, 2017
  19. Kaartic SivaraamJun 18, 2017
  20. Contextually notify user about an initial commitKaartic Sivaraam, Jun 18, 2017
  21. Ævar Arnfjörð BjarmasonJun 18, 2017
  22. 1/2 Contextually notify user about an initial commitKaartic Sivaraam, Jun 19, 2017
  23. 2/2 Add test for the new status messageKaartic Sivaraam, Jun 19, 2017
  24. Junio C HamanoJun 19, 2017
  25. Kaartic SivaraamJun 19, 2017
  26. Jeff KingJun 19, 2017
  27. Kaartic SivaraamJun 19, 2017
  28. Junio C HamanoJun 19, 2017
  29. 2/2 Add test for the new status messageKaartic Sivaraam, Jun 19, 2017
  30. Jeff KingJun 19, 2017
  31. Kaartic SivaraamJun 19, 2017
  32. Junio C HamanoJun 19, 2017
  33. 1/3 Contextually notify user about an initial commitKaartic Sivaraam, Jun 20, 2017
  34. 2/3 Update test(s) that used old status messageKaartic Sivaraam, Jun 20, 2017
  35. 3/3 Add tests for the contextual initial status messageKaartic Sivaraam, Jun 20, 2017
  36. Ævar Arnfjörð BjarmasonJun 20, 2017
  37. Kaartic SivaraamJun 20, 2017
  38. Ævar Arnfjörð BjarmasonJun 20, 2017
  39. Kaartic SivaraamJun 21, 2017
  40. status: contextually notify user about an initial commitKaartic Sivaraam, Jun 21, 2017
  41. Kaartic SivaraamJun 21, 2017
  42. Ævar Arnfjörð BjarmasonJun 21, 2017
  43. Kaartic SivaraamJun 21, 2017
  44. Junio C HamanoJun 21, 2017
  45. status: contextually notify user about an initial commitKaartic Sivaraam, Jun 21, 2017
  46. Junio C HamanoJun 22, 2017
  47. Kaartic SivaraamJun 22, 2017
  48. Philip OakleyJun 10, 2017

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.