Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tests for submodules for CVE-2022-39253 #2555

Merged
merged 1 commit into from Oct 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions pre_commit/git.py
Expand Up @@ -3,7 +3,7 @@
import logging
import os.path
import sys
from typing import MutableMapping
from typing import Mapping

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


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

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Expand Up @@ -23,5 +23,6 @@ env =
GIT_COMMITTER_NAME=test
GIT_AUTHOR_EMAIL=test@example.com
GIT_COMMITTER_EMAIL=test@example.com
GIT_ALLOW_PROTOCOL=file
VIRTUALENV_NO_DOWNLOAD=1
PRE_COMMIT_NO_CONCURRENCY=1