diff options
author | Philippe Blain <levraiphilippeblain@gmail.com> | 2020-01-21 15:01:15 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-01-22 13:36:05 -0800 |
commit | 4eaadc8493704357a4fac8d7dc8207340aa79019 (patch) | |
tree | 20a7b3d7d1951571bfa9cf2c76eebfbf6be4411e /t | |
parent | t7410: rename to t2405-worktree-submodule.sh (diff) | |
download | tgif-4eaadc8493704357a4fac8d7dc8207340aa79019.tar.xz |
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>
Diffstat (limited to 't')
-rwxr-xr-x | t/t2405-worktree-submodule.sh | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/t/t2405-worktree-submodule.sh b/t/t2405-worktree-submodule.sh index f2eee328cc..c4e555776a 100755 --- a/t/t2405-worktree-submodule.sh +++ b/t/t2405-worktree-submodule.sh @@ -6,32 +6,16 @@ test_description='Combination of submodules and multiple worktrees' base_path=$(pwd -P) -test_expect_success 'setup: make origin' ' - mkdir -p origin/sub && - ( - cd origin/sub && git init && - echo file1 >file1 && - git add file1 && - git commit -m file1 - ) && - mkdir -p origin/main && - ( - cd origin/main && git init && - git submodule add ../sub && - git commit -m "add sub" - ) && - ( - cd origin/sub && - echo file1updated >file1 && - git add file1 && - git commit -m "file1 updated" - ) && +test_expect_success 'setup: create origin repos' ' + git init origin/sub && + test_commit -C origin/sub file1 && + git init origin/main && + git -C origin/main submodule add ../sub && + git -C origin/main commit -m "add sub" && + test_commit -C origin/sub "file1 updated" file1 file1updated file1updated && git -C origin/main/sub pull && - ( - cd origin/main && - git add sub && - git commit -m "sub updated" - ) + git -C origin/main add sub && + git -C origin/main commit -m "sub updated" ' test_expect_success 'setup: clone' ' |