Skip to content

Commit bc96b0b

Browse files
committed
fix tests for submodules for CVE-2022-39253
1 parent 0239b27 commit bc96b0b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pre_commit/git.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import logging
44
import os.path
55
import sys
6-
from typing import MutableMapping
6+
from typing import Mapping
77

88
from pre_commit.errors import FatalError
99
from pre_commit.util import CalledProcessError
@@ -24,9 +24,7 @@ def zsplit(s: str) -> list[str]:
2424
return []
2525

2626

27-
def no_git_env(
28-
_env: MutableMapping[str, str] | None = None,
29-
) -> dict[str, str]:
27+
def no_git_env(_env: Mapping[str, str] | None = None) -> dict[str, str]:
3028
# Too many bugs dealing with environment variables and GIT:
3129
# https://github.com/pre-commit/pre-commit/issues/300
3230
# In git 2.6.3 (maybe others), git exports GIT_WORK_TREE while running
@@ -44,6 +42,7 @@ def no_git_env(
4442
'GIT_EXEC_PATH', 'GIT_SSH', 'GIT_SSH_COMMAND', 'GIT_SSL_CAINFO',
4543
'GIT_SSL_NO_VERIFY', 'GIT_CONFIG_COUNT',
4644
'GIT_HTTP_PROXY_AUTHMETHOD',
45+
'GIT_ALLOW_PROTOCOL',
4746
}
4847
}
4948

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ env =
2323
GIT_COMMITTER_NAME=test
2424
GIT_AUTHOR_EMAIL=test@example.com
2525
GIT_COMMITTER_EMAIL=test@example.com
26+
GIT_ALLOW_PROTOCOL=file
2627
VIRTUALENV_NO_DOWNLOAD=1
2728
PRE_COMMIT_NO_CONCURRENCY=1

0 commit comments

Comments
 (0)