Skip to content

Commit e25acfa

Browse files
authored
Fix tests for Git submodule (#3737)
I can't explain why this isn't happening for everyone, however the issue I git was that my global git config wasn't being picked up. This explicitly sets the user name and email to avoid erroring out on the following calls.
1 parent 230ec2b commit e25acfa

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

readthedocs/rtd_tests/utils.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
"""Utility functions for use in tests."""
2+
23
from __future__ import absolute_import
4+
35
import logging
6+
import subprocess
47
from os import chdir, environ, getcwd
58
from os.path import abspath, join as pjoin
69
from shutil import copytree
7-
import subprocess
810
from tempfile import mkdtemp
911

1012
from django_dynamic_fixture import new
1113
from django.contrib.auth.models import User
1214

15+
1316
log = logging.getLogger(__name__)
1417

1518

@@ -31,7 +34,19 @@ def make_test_git():
3134
env = environ.copy()
3235
env['GIT_DIR'] = pjoin(directory, '.git')
3336
chdir(directory)
37+
38+
# Initialize and configure
3439
log.info(check_output(['git', 'init'] + [directory], env=env))
40+
log.info(check_output(
41+
['git', 'config', 'user.email', '[email protected]'],
42+
env=env
43+
))
44+
log.info(check_output(
45+
['git', 'config', 'user.name', 'Read the Docs'],
46+
env=env
47+
))
48+
49+
# Set up the actual repository
3550
log.info(check_output(['git', 'add', '.'], env=env))
3651
log.info(check_output(['git', 'commit', '-m"init"'], env=env))
3752
# Add repo itself as submodule

0 commit comments

Comments
 (0)