Merge pull request #441 from alzeih/patch-1 · precommit/pre-commit@0e2c3c1 · GitHub
Skip to content

Commit 0e2c3c1

Browse files
authored
Merge pull request pre-commit#441 from alzeih/patch-1
Fix test error "fatal: empty ident name (for <(null)>) not allowed"
2 parents cf178f9 + bdcbdc2 commit 0e2c3c1

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

.travis.yml

Lines changed: 0 additions & 3 deletions

appveyor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ install:
1313
build: false
1414

1515
before_test:
16-
- git config --global user.name "AppVeyor CI"
17-
- git config --global user.email "user@example.com"
1816
# Shut up CRLF messages
1917
- git config --global core.safecrlf false
2018

tests/commands/install_uninstall_test.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,17 @@ def test_environment_not_sourced(tempdir_factory):
224224

225225
# Use a specific homedir to ignore --user installs
226226
homedir = tempdir_factory.get()
227-
# Need this so we can call git commit without sploding
228-
with io.open(os.path.join(homedir, '.gitconfig'), 'w') as gitconfig:
229-
gitconfig.write(
230-
'[user]\n'
231-
' name = Travis CI\n'
232-
' email = user@example.com\n'
233-
)
234227
ret, stdout, stderr = cmd_output(
235228
'git', 'commit', '--allow-empty', '-m', 'foo',
236-
env={'HOME': homedir, 'PATH': _path_without_us()},
229+
env={
230+
'HOME': homedir,
231+
'PATH': _path_without_us(),
232+
# Git needs this to make a commit
233+
'GIT_AUTHOR_NAME': os.environ['GIT_AUTHOR_NAME'],
234+
'GIT_COMMITTER_NAME': os.environ['GIT_COMMITTER_NAME'],
235+
'GIT_AUTHOR_EMAIL': os.environ['GIT_AUTHOR_EMAIL'],
236+
'GIT_COMMITTER_EMAIL': os.environ['GIT_COMMITTER_EMAIL'],
237+
},
237238
retcode=None,
238239
)
239240
assert ret == 1
@@ -475,6 +476,11 @@ def test_installed_from_venv(tempdir_factory):
475476
'SYSTEMROOT': os.environ.get('SYSTEMROOT', ''),
476477
# Windows needs this to resolve executables
477478
'PATHEXT': os.environ.get('PATHEXT', ''),
479+
# Git needs this to make a commit
480+
'GIT_AUTHOR_NAME': os.environ['GIT_AUTHOR_NAME'],
481+
'GIT_COMMITTER_NAME': os.environ['GIT_COMMITTER_NAME'],
482+
'GIT_AUTHOR_EMAIL': os.environ['GIT_AUTHOR_EMAIL'],
483+
'GIT_COMMITTER_EMAIL': os.environ['GIT_COMMITTER_EMAIL'],
478484
},
479485
)
480486
assert ret == 0

tox.ini

Lines changed: 6 additions & 1 deletion

0 commit comments

Comments
 (0)