t/t3NNN: allow local submodules
To prepare for the default value of `protocol.file.allow` to change to "user", ensure tests that rely on local submodules can initialize them over the file protocol. Tests that only need to interact with submodules in a limited capacity have individual Git commands annotated with the appropriate configuration via `-c`. Tests that interact with submodules a handful of times use `test_config_global` instead. Test scripts that rely on submodules throughout use a `git config --global` during a setup test towards the beginning of the script. Signed-off-by: Taylor Blau <me@ttaylorr.com>
This commit is contained in:
parent
99f4abb8da
commit
f8d510ed0b
@ -279,6 +279,7 @@ test_expect_success 'deleting checked-out branch from repo that is a submodule'
|
|||||||
git init repo1 &&
|
git init repo1 &&
|
||||||
git init repo1/sub &&
|
git init repo1/sub &&
|
||||||
test_commit -C repo1/sub x &&
|
test_commit -C repo1/sub x &&
|
||||||
|
test_config_global protocol.file.allow always &&
|
||||||
git -C repo1 submodule add ./sub &&
|
git -C repo1 submodule add ./sub &&
|
||||||
git -C repo1 commit -m "adding sub" &&
|
git -C repo1 commit -m "adding sub" &&
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ test_expect_success 'autostash is saved on editor failure with conflict' '
|
|||||||
test_expect_success 'autostash with dirty submodules' '
|
test_expect_success 'autostash with dirty submodules' '
|
||||||
test_when_finished "git reset --hard && git checkout master" &&
|
test_when_finished "git reset --hard && git checkout master" &&
|
||||||
git checkout -b with-submodule &&
|
git checkout -b with-submodule &&
|
||||||
git submodule add ./ sub &&
|
git -c protocol.file.allow=always submodule add ./ sub &&
|
||||||
test_tick &&
|
test_tick &&
|
||||||
git commit -m add-submodule &&
|
git commit -m add-submodule &&
|
||||||
echo changed >sub/file0 &&
|
echo changed >sub/file0 &&
|
||||||
|
@ -47,7 +47,8 @@ test_expect_success 'rebase interactive ignores modified submodules' '
|
|||||||
git init sub &&
|
git init sub &&
|
||||||
git -C sub commit --allow-empty -m "Initial commit" &&
|
git -C sub commit --allow-empty -m "Initial commit" &&
|
||||||
git init super &&
|
git init super &&
|
||||||
git -C super submodule add ../sub &&
|
git -c protocol.file.allow=always \
|
||||||
|
-C super submodule add ../sub &&
|
||||||
git -C super config submodule.sub.ignore dirty &&
|
git -C super config submodule.sub.ignore dirty &&
|
||||||
>super/foo &&
|
>super/foo &&
|
||||||
git -C super add foo &&
|
git -C super add foo &&
|
||||||
|
@ -10,6 +10,8 @@ KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
|
|||||||
test_submodule_switch "cherry-pick"
|
test_submodule_switch "cherry-pick"
|
||||||
|
|
||||||
test_expect_success 'unrelated submodule/file conflict is ignored' '
|
test_expect_success 'unrelated submodule/file conflict is ignored' '
|
||||||
|
test_config_global protocol.file.allow always &&
|
||||||
|
|
||||||
test_create_repo sub &&
|
test_create_repo sub &&
|
||||||
|
|
||||||
touch sub/file &&
|
touch sub/file &&
|
||||||
|
@ -321,7 +321,7 @@ test_expect_success 'rm removes empty submodules from work tree' '
|
|||||||
|
|
||||||
test_expect_success 'rm removes removed submodule from index and .gitmodules' '
|
test_expect_success 'rm removes removed submodule from index and .gitmodules' '
|
||||||
git reset --hard &&
|
git reset --hard &&
|
||||||
git submodule update &&
|
git -c protocol.file.allow=always submodule update &&
|
||||||
rm -rf submod &&
|
rm -rf submod &&
|
||||||
git rm submod &&
|
git rm submod &&
|
||||||
git status -s -uno --ignore-submodules=none >actual &&
|
git status -s -uno --ignore-submodules=none >actual &&
|
||||||
@ -627,6 +627,7 @@ cat >expect.deepmodified <<EOF
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
test_expect_success 'setup subsubmodule' '
|
test_expect_success 'setup subsubmodule' '
|
||||||
|
test_config_global protocol.file.allow always &&
|
||||||
git reset --hard &&
|
git reset --hard &&
|
||||||
git submodule update &&
|
git submodule update &&
|
||||||
(
|
(
|
||||||
|
@ -36,7 +36,7 @@ setup_basic () {
|
|||||||
git init main &&
|
git init main &&
|
||||||
(
|
(
|
||||||
cd main &&
|
cd main &&
|
||||||
git submodule add ../sub &&
|
git -c protocol.file.allow=always submodule add ../sub &&
|
||||||
test_commit main_file
|
test_commit main_file
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user