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

[PATCH 1/3] Make test "using invalid commit with -C" more strict

From
Kacper Kornet <draenog@pld-linux.org>
Date
Aug 24, 2013, 04:01 UTC
Message-ID
<1377316906-70338-2-git-send-email-draenog@pld-linux.org>
In-Reply-To
<1377316906-70338-1-git-send-email-draenog@pld-linux.org>

In the test 'using invalid commit with -C' git-commit would have failed even if the -C option had been given the correct commit, as there was nothing to commit. Fix it by making sure there is always something to commit and git-commit fails because of the invalid commit provided to it.

Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
---
 t/t7501-commit.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 99ce36f..699a603 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -53,7 +53,10 @@ test_expect_success PERL 'can use paths with --interactive' '
 '
 
 test_expect_success 'using invalid commit with -C' '
-	test_must_fail git commit -C bogus
+	echo bong >file &&
+	git add file &&
+	test_must_fail git commit -C bogus &&
+	git reset
 '
 
 test_expect_success 'nothing to commit' '
-- 
1.8.3.4
Previous: Kacper KornetNext: Jonathan Nieder
Message 2 of 12 in “Fixes for tests run without perl”
  1. 0/3 Fixes for tests run without perlKacper Kornet, Aug 24, 2013
  2. 1/3 Make test "using invalid commit with -C" more strictKacper Kornet, Aug 24, 2013
  3. Jonathan NiederAug 24, 2013
  4. Junio C HamanoAug 25, 2013
  5. Jonathan NiederAug 25, 2013
  6. 2/3 t/t3701-add-interactive.sh: Add PERL prerequisiteKacper Kornet, Aug 24, 2013
  7. Jonathan NiederAug 24, 2013
  8. 3/3 t/t7106-reset-unborn-branch.sh: Add PERL prerequisiteKacper Kornet, Aug 24, 2013
  9. Jonathan NiederAug 24, 2013
  10. Junio C HamanoAug 25, 2013
  11. Jonathan NiederAug 25, 2013
  12. Jonathan NiederAug 24, 2013

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.