Re: [PATCH] t7300: fix broken && chains

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] t7300: fix broken && chains

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:06:22

Erik Elfström [off-list ref] writes:
While we are here, remove some boilerplate by using test_commit.

Signed-off-by: Erik Elfström <redacted>
---
Many of the constructs we see here shows clearly that this is an
ancient part of the codebase ;-), as we would be using the one
parameter form of "git init" and more test_* helpers if we were
writing this script in today's Git codebase.  It may have been
better if you didn't do "while we are here" and corrected only the
&&-chain in patch 1/2 and then updated the style of the tests to
take advantage of the newer facilities recent test-lib has in a
separate patch 2/2, but this will do at least for now.

Will queue.

Thanks.

quoted hunk
 t/t7300-clean.sh | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 27557d6..86ceb38 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -432,9 +432,7 @@ test_expect_success 'nested git work tree' '
 	(
 		cd foo &&
 		git init &&
-		>hello.world
-		git add . &&
-		git commit -a -m nested
+		test_commit nested hello.world
 	) &&
 	(
 		cd bar &&
@@ -443,9 +441,7 @@ test_expect_success 'nested git work tree' '
 	(
 		cd baz/boo &&
 		git init &&
-		>deeper.world
-		git add . &&
-		git commit -a -m deeply.nested
+		test_commit deeply.nested deeper.world
 	) &&
 	git clean -f -d &&
 	test -f foo/.git/index &&
@@ -601,9 +597,7 @@ test_expect_success 'force removal of nested git work tree' '
 	(
 		cd foo &&
 		git init &&
-		>hello.world
-		git add . &&
-		git commit -a -m nested
+		test_commit nested hello.world
 	) &&
 	(
 		cd bar &&
@@ -612,9 +606,7 @@ test_expect_success 'force removal of nested git work tree' '
 	(
 		cd baz/boo &&
 		git init &&
-		>deeper.world
-		git add . &&
-		git commit -a -m deeply.nested
+		test_commit deeply.nested deeper.world
 	) &&
 	git clean -f -f -d &&
 	! test -d foo &&

Re: [PATCH] t7300: fix broken && chains

From: erik elfström <hidden>
Date: 2016-06-15 23:06:23

On Mon, Aug 31, 2015 at 6:58 PM, Junio C Hamano [off-list ref] wrote:
Many of the constructs we see here shows clearly that this is an
ancient part of the codebase ;-), as we would be using the one
parameter form of "git init" and more test_* helpers if we were
writing this script in today's Git codebase.  It may have been
better if you didn't do "while we are here" and corrected only the
&&-chain in patch 1/2 and then updated the style of the tests to
take advantage of the newer facilities recent test-lib has in a
separate patch 2/2, but this will do at least for now.

Will queue.

Thanks.

I can do a re-roll with the chain fix in the first patch and a more
thorough modernization of t7300 in separate patches if you'd like? I
almost went this way for v1 but decided to limit the scope for the
first version.

(Forgot to include the list in my first reply, sorry... And forgot to
turn off HTML in the second... sigh, sorry for the spam)

/Erik
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help