Support testing with newer version of Git

This commit is contained in:
Tim Byrne 2023-07-08 14:28:00 -05:00
parent 2253e52ab7
commit 82ba16db34
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
3 changed files with 9 additions and 0 deletions

View File

@ -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"')

View File

@ -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:

View File

@ -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')