threads / patch / 49449

patcht1400: drop debug `echo` to actually execute `test`

Subject: [PATCH] t1400: drop debug `echo` to actually execute `test`

## tl;dr

2 messages between Sep 28, 2018 and Sep 29, 2018. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Martin Ågren· Sep 28, 2018, 15:43 UTC · lore

Instead of running `test "foo" = "$(bar)"`, we prefix the whole thing with `echo`. Comparing to nearby tests makes it clear that this is just debug leftover. This line has actually been modified four times since it was introduced in e52290428b (General ref log reading improvements., 2006-05-19) and the `echo` has always survived. Let's finally drop it.

This script could need some more cleanups. This is just an immediate fix so that we actually test what we intend to.

All other hits for `git grep "\<echo test " -- t/` seem fine. They want to create some input or expected output data.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 t/t1400-update-ref.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to t/t1400-update-ref.sh +1 −1
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 02493f14ba..b72beebe42 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -359,21 +359,21 @@ ld="Thu, 26 May 2005 18:43:00 -0500"
 test_expect_success 'Query "master@{May 25 2005}" (before history)' '
 	test_when_finished "rm -f o e" &&
 	git rev-parse --verify "master@{May 25 2005}" >o 2>e &&
 	test $C = $(cat o) &&
 	test "warning: Log for '\''master'\'' only goes back to $ed." = "$(cat e)"
 '
 test_expect_success 'Query master@{2005-05-25} (before history)' '
 	test_when_finished "rm -f o e" &&
 	git rev-parse --verify master@{2005-05-25} >o 2>e &&
 	test $C = $(cat o) &&
-	echo test "warning: Log for '\''master'\'' only goes back to $ed." = "$(cat e)"
+	test "warning: Log for '\''master'\'' only goes back to $ed." = "$(cat e)"
 '
 test_expect_success 'Query "master@{May 26 2005 23:31:59}" (1 second before history)' '
 	test_when_finished "rm -f o e" &&
 	git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e &&
 	test $C = $(cat o) &&
 	test "warning: Log for '\''master'\'' only goes back to $ed." = "$(cat e)"
 '
 test_expect_success 'Query "master@{May 26 2005 23:32:00}" (exactly history start)' '
 	test_when_finished "rm -f o e" &&
 	git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
-- 
2.19.0.216.g2d3b1c576c
Jeff King· Sep 29, 2018, 08:00 UTC · re: Martin Ågren · lore

Re: [PATCH] t1400: drop debug `echo` to actually execute `test`

On Fri, Sep 28, 2018 at 05:43:59PM +0200, Martin Ågren wrote:
Show 5 quoted lines
> Instead of running `test "foo" = "$(bar)"`, we prefix the whole thing
> with `echo`. Comparing to nearby tests makes it clear that this is just
> debug leftover. This line has actually been modified four times since it
> was introduced in e52290428b (General ref log reading improvements.,
> 2006-05-19) and the `echo` has always survived. Let's finally drop it.
Hmm, yeah. I cannot see how this echo was ever accomplishing anything.
> This script could need some more cleanups. This is just an immediate fix
> so that we actually test what we intend to.

Yeah, this is definitely worth doing now, and not holding hostage to a bigger cleanup.

> ---
>  t/t1400-update-ref.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
The patch looks good to me. Thanks!
-Peff

← back to recent threads