From 82ba16db34f1b8375cf3e70c490819e04e959e26 Mon Sep 17 00:00:00 2001 From: Tim Byrne Date: Sat, 8 Jul 2023 14:28:00 -0500 Subject: [PATCH] Support testing with newer version of Git --- test/conftest.py | 3 +++ test/test_init.py | 2 ++ test/test_upgrade.py | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/test/conftest.py b/test/conftest.py index f3ce22c..db15e4a 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -267,6 +267,9 @@ def runner(): @pytest.fixture(scope='session') def config_git(): """Configure global git configuration, if missing""" + os.system( + 'git config init.defaultBranch || ' + 'git config --global init.defaultBranch master') os.system( 'git config user.name || ' 'git config --global user.name "test"') diff --git a/test/test_init.py b/test/test_init.py index 5542332..3d149d6 100644 --- a/test/test_init.py +++ b/test/test_init.py @@ -56,6 +56,8 @@ def test_init( args.append('-f') # run init + runner(['git', 'config', '--global', 'init.defaultBranch', 'master'], + env={'HOME': home}, cwd=cwd) run = runner(yadm_cmd(*args), env={'HOME': home}, cwd=cwd) if repo_present and not force: diff --git a/test/test_upgrade.py b/test/test_upgrade.py index 2d4d697..f1a5076 100644 --- a/test/test_upgrade.py +++ b/test/test_upgrade.py @@ -22,6 +22,10 @@ def test_upgrade(tmpdir, runner, versions, submodule): # pylint: disable=too-many-statements home = tmpdir.mkdir('HOME') env = {'HOME': str(home)} + runner(['git', 'config', '--global', 'init.defaultBranch', 'master'], + env=env) + runner(['git', 'config', '--global', 'protocol.file.allow', 'always'], + env=env) if submodule: ext_repo = tmpdir.mkdir('ext_repo')