t/t5NNN: 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
ac7e57fa28
commit
225d2d50cc
@ -627,6 +627,7 @@ test_expect_success 'fetch.writeCommitGraph' '
|
||||
'
|
||||
|
||||
test_expect_success 'fetch.writeCommitGraph with submodules' '
|
||||
test_config_global protocol.file.allow always &&
|
||||
git clone dups super &&
|
||||
(
|
||||
cd super &&
|
||||
|
@ -35,6 +35,7 @@ add_upstream_commit() {
|
||||
}
|
||||
|
||||
test_expect_success setup '
|
||||
git config --global protocol.file.allow always &&
|
||||
mkdir deepsubmodule &&
|
||||
(
|
||||
cd deepsubmodule &&
|
||||
|
@ -113,6 +113,7 @@ test_expect_success 'push options and submodules' '
|
||||
test_commit -C parent one &&
|
||||
git -C parent push --mirror up &&
|
||||
|
||||
test_config_global protocol.file.allow always &&
|
||||
git -C parent submodule add ../upstream workbench &&
|
||||
git -C parent/workbench remote add up ../../upstream &&
|
||||
git -C parent commit -m "add submodule" &&
|
||||
|
@ -46,6 +46,10 @@ KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
|
||||
KNOWN_FAILURE_NOFF_MERGE_ATTEMPTS_TO_MERGE_REMOVED_SUBMODULE_FILES=1
|
||||
test_submodule_switch_func "git_pull_noff"
|
||||
|
||||
test_expect_success 'setup' '
|
||||
git config --global protocol.file.allow always
|
||||
'
|
||||
|
||||
test_expect_success 'pull --recurse-submodule setup' '
|
||||
test_create_repo child &&
|
||||
test_commit -C child bar &&
|
||||
|
@ -738,6 +738,7 @@ test_expect_success 'batch missing blob request does not inadvertently try to fe
|
||||
echo aa >server/a &&
|
||||
echo bb >server/b &&
|
||||
# Also add a gitlink pointing to an arbitrary repository
|
||||
test_config_global protocol.file.allow always &&
|
||||
git -C server submodule add "$(pwd)/repo_for_submodule" c &&
|
||||
git -C server add a b c &&
|
||||
git -C server commit -m x &&
|
||||
|
@ -24,6 +24,7 @@ test_expect_success 'setup' '
|
||||
|
||||
test_expect_success 'nonshallow clone implies nonshallow submodule' '
|
||||
test_when_finished "rm -rf super_clone" &&
|
||||
test_config_global protocol.file.allow always &&
|
||||
git clone --recurse-submodules "file://$pwd/." super_clone &&
|
||||
git -C super_clone log --oneline >lines &&
|
||||
test_line_count = 3 lines &&
|
||||
@ -33,6 +34,7 @@ test_expect_success 'nonshallow clone implies nonshallow submodule' '
|
||||
|
||||
test_expect_success 'shallow clone with shallow submodule' '
|
||||
test_when_finished "rm -rf super_clone" &&
|
||||
test_config_global protocol.file.allow always &&
|
||||
git clone --recurse-submodules --depth 2 --shallow-submodules "file://$pwd/." super_clone &&
|
||||
git -C super_clone log --oneline >lines &&
|
||||
test_line_count = 2 lines &&
|
||||
@ -42,6 +44,7 @@ test_expect_success 'shallow clone with shallow submodule' '
|
||||
|
||||
test_expect_success 'shallow clone does not imply shallow submodule' '
|
||||
test_when_finished "rm -rf super_clone" &&
|
||||
test_config_global protocol.file.allow always &&
|
||||
git clone --recurse-submodules --depth 2 "file://$pwd/." super_clone &&
|
||||
git -C super_clone log --oneline >lines &&
|
||||
test_line_count = 2 lines &&
|
||||
@ -51,6 +54,7 @@ test_expect_success 'shallow clone does not imply shallow submodule' '
|
||||
|
||||
test_expect_success 'shallow clone with non shallow submodule' '
|
||||
test_when_finished "rm -rf super_clone" &&
|
||||
test_config_global protocol.file.allow always &&
|
||||
git clone --recurse-submodules --depth 2 --no-shallow-submodules "file://$pwd/." super_clone &&
|
||||
git -C super_clone log --oneline >lines &&
|
||||
test_line_count = 2 lines &&
|
||||
@ -60,6 +64,7 @@ test_expect_success 'shallow clone with non shallow submodule' '
|
||||
|
||||
test_expect_success 'non shallow clone with shallow submodule' '
|
||||
test_when_finished "rm -rf super_clone" &&
|
||||
test_config_global protocol.file.allow always &&
|
||||
git clone --recurse-submodules --no-local --shallow-submodules "file://$pwd/." super_clone &&
|
||||
git -C super_clone log --oneline >lines &&
|
||||
test_line_count = 3 lines &&
|
||||
@ -69,6 +74,7 @@ test_expect_success 'non shallow clone with shallow submodule' '
|
||||
|
||||
test_expect_success 'clone follows shallow recommendation' '
|
||||
test_when_finished "rm -rf super_clone" &&
|
||||
test_config_global protocol.file.allow always &&
|
||||
git config -f .gitmodules submodule.sub.shallow true &&
|
||||
git add .gitmodules &&
|
||||
git commit -m "recommend shallow for sub" &&
|
||||
@ -87,6 +93,7 @@ test_expect_success 'clone follows shallow recommendation' '
|
||||
|
||||
test_expect_success 'get unshallow recommended shallow submodule' '
|
||||
test_when_finished "rm -rf super_clone" &&
|
||||
test_config_global protocol.file.allow always &&
|
||||
git clone --no-local "file://$pwd/." super_clone &&
|
||||
(
|
||||
cd super_clone &&
|
||||
@ -103,6 +110,7 @@ test_expect_success 'get unshallow recommended shallow submodule' '
|
||||
|
||||
test_expect_success 'clone follows non shallow recommendation' '
|
||||
test_when_finished "rm -rf super_clone" &&
|
||||
test_config_global protocol.file.allow always &&
|
||||
git config -f .gitmodules submodule.sub.shallow false &&
|
||||
git add .gitmodules &&
|
||||
git commit -m "recommend non shallow for sub" &&
|
||||
|
@ -171,6 +171,8 @@ test_expect_success 'partial clone with transfer.fsckobjects=1 works with submod
|
||||
test_config -C src_with_sub uploadpack.allowfilter 1 &&
|
||||
test_config -C src_with_sub uploadpack.allowanysha1inwant 1 &&
|
||||
|
||||
test_config_global protocol.file.allow always &&
|
||||
|
||||
git -C src_with_sub submodule add "file://$(pwd)/submodule" mysub &&
|
||||
git -C src_with_sub commit -m "commit with submodule" &&
|
||||
|
||||
|
@ -7,6 +7,7 @@ test_description='Test cloning repos with submodules using remote-tracking branc
|
||||
pwd=$(pwd)
|
||||
|
||||
test_expect_success 'setup' '
|
||||
git config --global protocol.file.allow always &&
|
||||
git checkout -b master &&
|
||||
test_commit commit1 &&
|
||||
mkdir sub &&
|
||||
|
Loading…
Reference in New Issue
Block a user