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

[PATCH 3/4] t3400 (rebase): move lone statement into a test

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
May 10, 2013, 14:29 UTC
Message-ID
<1368196178-5807-4-git-send-email-artagnon@gmail.com>
In-Reply-To
<1368196178-5807-1-git-send-email-artagnon@gmail.com>

'rm -f B' is a lone statement that isn't contained inside any test_expect_* block. Use test_when_finished to execute it after the preceding test has finished.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 t/t3400-rebase.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index cb4234a..0841a12 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -154,11 +154,11 @@ test_expect_success 'setup: recover' '
 
 test_expect_success 'show verbose error when HEAD could not be detached' '
 	>B &&
+	test_when_finished rm -f B &&
 	test_must_fail git rebase topic 2>output.err >output.out &&
 	grep "The following untracked working tree files would be overwritten by checkout:" output.err &&
 	grep B output.err
 '
-rm -f B
 
 test_expect_success 'fail when upstream arg is missing and not on branch' '
 	git checkout topic &&
-- 
1.8.3.rc1.52.gc14258d
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 7 of 21 in “Trivial cleanups to t3400 (rebase)”
  1. 0/4 Trivial cleanups to t3400 (rebase)Ramkumar Ramachandra, May 10, 2013
  2. 1/4 t3400 (rebase): don't set GIT_AUTHOR_{NAME,EMAIL}Ramkumar Ramachandra, May 10, 2013
  3. Eric SunshineMay 10, 2013
  4. Ramkumar RamachandraMay 10, 2013
  5. Junio C HamanoMay 10, 2013
  6. 2/4 t3400 (rebase): downcase a couple of test titlesRamkumar Ramachandra, May 10, 2013
  7. 3/4 t3400 (rebase): move lone statement into a testRamkumar Ramachandra, May 10, 2013
  8. 4/4 t4300 (rebase): don't unnecessarily set GIT_TRACERamkumar Ramachandra, May 10, 2013
  9. Junio C HamanoMay 10, 2013
  10. Ramkumar RamachandraMay 10, 2013
  11. Junio C HamanoMay 10, 2013
  12. Ramkumar RamachandraMay 10, 2013
  13. Junio C HamanoMay 10, 2013
  14. Ramkumar RamachandraMay 10, 2013
  15. Ramkumar RamachandraMay 10, 2013
  16. Jonathan NiederMay 10, 2013
  17. Ramkumar RamachandraMay 10, 2013
  18. Jonathan NiederMay 10, 2013
  19. Junio C HamanoMay 10, 2013
  20. Ramkumar RamachandraMay 11, 2013
  21. Jonathan NiederMay 13, 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.