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

unset git global configs #501

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion TarSCM/scm/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class Git(Scm):
_stash_pop_required = False
partial_clone = False

def __init__(self, args, task):
super().__init__(args, task)
if not os.getenv('GIT_CONFIG_GLOBAL', None):
os.putenv('GIT_CONFIG_GLOBAL', '/dev/null')

def _get_scm_cmd(self):
"""Compose a GIT-specific command line using http proxies"""
# git should honor the http[s]_proxy variables, but we need to
Expand Down Expand Up @@ -228,7 +233,9 @@ def update_cache(self):
self.auth_url()
try:
self.helpers.safe_run(
self._get_scm_cmd() + ['config', 'remote.origin.url',
self._get_scm_cmd() + ['config',
'--local',
'remote.origin.url',
self.url],
cwd=self.clone_dir,
interactive=sys.stdout.isatty()
Expand Down
Loading