@matheusbsbs / matheus-bagliano / commits / 4eaadc8493
Fork 0

t2405: use git -C and test_commit -C instead of subshells

The subshells used in the setup phase of this test are unnecessary. Remove them by using 'git -C' and 'test_commit -C'. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Philippe Blain committed Jan 21, 2020 at 15:01 UTC 4eaadc8493704357a4fac8d7dc8207340aa79019
1 file changed +9 -25
t/t2405-worktree-submodule.sh
+9 -25
@@ -6,32 +6,16 @@ test_description='Combination of submodules and multiple worktrees'
6
7 base_path=$(pwd -P)
8
9 -test_expect_success 'setup: make origin' '
10 - mkdir -p origin/sub &&
11 - (
12 - cd origin/sub && git init &&
13 - echo file1 >file1 &&
14 - git add file1 &&
15 - git commit -m file1
16 - ) &&
17 - mkdir -p origin/main &&
18 - (
19 - cd origin/main && git init &&
20 - git submodule add ../sub &&
21 - git commit -m "add sub"
22 - ) &&
23 - (
24 - cd origin/sub &&
25 - echo file1updated >file1 &&
26 - git add file1 &&
27 - git commit -m "file1 updated"
28 - ) &&
9 +test_expect_success 'setup: create origin repos' '
10 + git init origin/sub &&
11 + test_commit -C origin/sub file1 &&
12 + git init origin/main &&
13 + git -C origin/main submodule add ../sub &&
14 + git -C origin/main commit -m "add sub" &&
15 + test_commit -C origin/sub "file1 updated" file1 file1updated file1updated &&
16 git -C origin/main/sub pull &&
30 - (
31 - cd origin/main &&
32 - git add sub &&
33 - git commit -m "sub updated"
34 - )
17 + git -C origin/main add sub &&
18 + git -C origin/main commit -m "sub updated"
19 '
20
21 test_expect_success 'setup: clone' '