test-lib: parse options in a for loop to keep $@ intact
[gitweb.git] / t / lib-submodule-update.sh
index 5b56b23166bb3dea2e89cea38a19eb5698dfff53..016391723c09491e53ebf4e0b69972783c7bc491 100755 (executable)
@@ -235,7 +235,7 @@ reset_work_tree_to_interested () {
        then
                mkdir -p submodule_update/.git/modules/sub1/modules &&
                cp -r submodule_update_repo/.git/modules/sub1/modules/sub2 submodule_update/.git/modules/sub1/modules/sub2
-               # core.worktree is unset for sub2 as it is not checked out
+               GIT_WORK_TREE=. git -C submodule_update/.git/modules/sub1/modules/sub2 config --unset core.worktree
        fi &&
        # indicate we are interested in the submodule:
        git -C submodule_update config submodule.sub1.url "bogus" &&
@@ -709,8 +709,7 @@ test_submodule_recursing_with_args_common() {
                        git branch -t remove_sub1 origin/remove_sub1 &&
                        $command remove_sub1 &&
                        test_superproject_content origin/remove_sub1 &&
-                       ! test -e sub1 &&
-                       test_must_fail git config -f .git/modules/sub1/config core.worktree
+                       ! test -e sub1
                )
        '
        # ... absorbing a .git directory along the way.