t7400: encapsulate setup code in test_expect_success
authorStefan Beller <sbeller@google.com>
Mon, 18 Jun 2018 23:41:48 +0000 (16:41 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Jun 2018 16:25:56 +0000 (09:25 -0700)
When running t7400 in a shell you observe more output than expected:

...
ok 8 - setup - hide init subdirectory
ok 9 - setup - repository to add submodules to
ok 10 - submodule add
[master (root-commit) d79ce16] one
Author: A U Thor <author@example.com>
1 file changed, 1 insertion(+)
create mode 100644 one.t
ok 11 - redirected submodule add does not show progress
ok 12 - redirected submodule add --progress does show progress
ok 13 - submodule add to .gitignored path fails
...

Fix the output by encapsulating the setup code in test_expect_success

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7400-submodule-basic.sh
index b5b4922aba72d18c221571a1523d3d5785923797..d501ab4b613cd351c15c07f7a4fec4c28f6c8981 100755 (executable)
@@ -126,8 +126,10 @@ test_expect_success 'submodule add' '
        test_cmp empty untracked
 '
 
-test_create_repo parent &&
-test_commit -C parent one
+test_expect_success 'setup parent and one repository' '
+       test_create_repo parent &&
+       test_commit -C parent one
+'
 
 test_expect_success 'redirected submodule add does not show progress' '
        git -C addtest submodule add "file://$submodurl/parent" submod-redirected \