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

Re: [PATCH 3/3] t/t7106-reset-unborn-branch.sh: Add PERL prerequisite

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 25, 2013, 07:09 UTC
Message-ID
<20130825070911.GU2882@elie.Belkin>
In-Reply-To
<xmqq8uzql0vr.fsf@gitster.dls.corp.google.com>
Junio C Hamano wrote:
> The change to the one that feeds 'y' to "reset -p" may be a bit too
> pedantic, as we are not in the business of testing "echo y", though.
Yeah, that's true.  Here's a patch for squashing in.
diff --git i/t/t7106-reset-unborn-branch.sh w/t/t7106-reset-unborn-branch.sh
index af00ab4d..bd28feba 100755
--- i/t/t7106-reset-unborn-branch.sh
+++ w/t/t7106-reset-unborn-branch.sh
@@ -12,9 +12,8 @@ test_expect_success 'reset' '
 	git add a b &&
 	git reset &&
 
-	>expect &&
 	git ls-files >actual &&
-	test_cmp expect actual
+	test_must_be_empty actual
 '
 
 test_expect_success 'reset HEAD' '
@@ -36,12 +35,10 @@ test_expect_success 'reset $file' '
 test_expect_success PERL 'reset -p' '
 	rm .git/index &&
 	git add a &&
-	echo y >yes &&
-	git reset -p <yes &&
+	echo y | git reset -p &&
 
-	>expect &&
 	git ls-files >actual &&
-	test_cmp expect actual
+	test_must_be_empty actual
 '
 
 test_expect_success 'reset --soft is a no-op' '
@@ -60,9 +57,8 @@ test_expect_success 'reset --hard' '
 	test_when_finished "echo a >a" &&
 	git reset --hard &&
 
-	>expect &&
 	git ls-files >actual &&
-	test_cmp expect actual &&
+	test_must_be_empty actual &&
 	test_path_is_missing a
 '
 
Previous: Junio C HamanoNext: Jonathan Nieder
Message 11 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.