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

[PATCH v3 04/10] t7001: modernize subshell formatting

From
Shubham Verma <shubhunic@gmail.com>
Date
Feb 11, 2021, 19:46 UTC
Message-ID
<20210211194704.28913-5-shubhunic@gmail.com>
In-Reply-To
<20210211194704.28913-1-shubhunic@gmail.com>
Some test use an old style for formatting subshells:
        (command &&
            ...
Update them to the modern style:
        (
            command &&
            ...
Signed-off-by: Shubham Verma <shubhunic@gmail.com>
---
 t/t7001-mv.sh | 74 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 40 insertions(+), 34 deletions(-)
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index e98b44f7a1..7fd4341988 100755
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
@@ -181,38 +181,42 @@ test_expect_success "Sergey Vlasov's test case" '
 	git mv ab a
 '
 
-test_expect_success 'absolute pathname' '(
-	rm -fr mine &&
-	mkdir mine &&
-	cd mine &&
-	test_create_repo one &&
-	cd one &&
-	mkdir sub &&
-	>sub/file &&
-	git add sub/file &&
-
-	git mv sub "$(pwd)/in" &&
-	! test -d sub &&
-	test -d in &&
-	git ls-files --error-unmatch in/file
-)'
-
-test_expect_success 'absolute pathname outside should fail' '(
-	rm -fr mine &&
-	mkdir mine &&
-	cd mine &&
-	out=$(pwd) &&
-	test_create_repo one &&
-	cd one &&
-	mkdir sub &&
-	>sub/file &&
-	git add sub/file &&
-
-	test_must_fail git mv sub "$out/out" &&
-	test -d sub &&
-	! test -d ../in &&
-	git ls-files --error-unmatch sub/file
-)'
+test_expect_success 'absolute pathname' '
+	(
+		rm -fr mine &&
+		mkdir mine &&
+		cd mine &&
+		test_create_repo one &&
+		cd one &&
+		mkdir sub &&
+		>sub/file &&
+		git add sub/file &&
+
+		git mv sub "$(pwd)/in" &&
+		! test -d sub &&
+		test -d in &&
+		git ls-files --error-unmatch in/file
+	)
+'
+
+test_expect_success 'absolute pathname outside should fail' '
+	(
+		rm -fr mine &&
+		mkdir mine &&
+		cd mine &&
+		out=$(pwd) &&
+		test_create_repo one &&
+		cd one &&
+		mkdir sub &&
+		>sub/file &&
+		git add sub/file &&
+
+		test_must_fail git mv sub "$out/out" &&
+		test -d sub &&
+		! test -d ../in &&
+		git ls-files --error-unmatch sub/file
+	)
+'
 
 test_expect_success 'git mv to move multiple sources into a directory' '
 	rm -fr .git && git init &&
@@ -503,14 +507,16 @@ test_expect_success 'moving a submodule in nested directories' '
 test_expect_success 'moving nested submodules' '
 	git commit -am "cleanup commit" &&
 	mkdir sub_nested_nested &&
-	(cd sub_nested_nested &&
+	(
+		cd sub_nested_nested &&
 		touch nested_level2 &&
 		git init &&
 		git add . &&
 		git commit -m "nested level 2"
 	) &&
 	mkdir sub_nested &&
-	(cd sub_nested &&
+	(
+		cd sub_nested &&
 		touch nested_level1 &&
 		git init &&
 		git add . &&
-- 
2.25.1
Previous: Shubham VermaNext: Shubham Verma
Message 7 of 14 in “Modernizing the t7001 test script”
  1. 00/10 Modernizing the t7001 test scriptShubham Verma, Feb 11, 2021
  2. 01/10 t7001: modernize test formattingShubham Verma, Feb 11, 2021
  3. 03/10 t7001: remove unnecessary blank linesShubham Verma, Feb 11, 2021
  4. 02/10 t7001: indent with TABs instead of spacesShubham Verma, Feb 11, 2021
  5. 05/10 t7001: remove whitespace after redirect operatorsShubham Verma, Feb 11, 2021
  6. 07/10 t7001: use '>' rather than 'touch'Shubham Verma, Feb 11, 2021
  7. 04/10 t7001: modernize subshell formattingShubham Verma, Feb 11, 2021
  8. 06/10 t7001: avoid using `cd` outside of subshellsShubham Verma, Feb 11, 2021
  9. 10/10 t7001: use `test` rather than `[`Shubham Verma, Feb 11, 2021
  10. 08/10 t7001: put each command on a separate lineShubham Verma, Feb 11, 2021
  11. 09/10 t7001: use here-docs instead of echoShubham Verma, Feb 11, 2021
  12. Junio C HamanoFeb 11, 2021
  13. Shubham VermaFeb 23, 2021
  14. Junio C HamanoFeb 23, 2021

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.