Skip to content

Commit ad20761

Browse files
committed
addons.git: ignore global user and system git config
When running `git log`. Note that GIT_CONFIG_SYSTEM and GIT_CONFIG_GLOBAL support was added in git-2.32. Fixes #336.
1 parent 3684d06 commit ad20761

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/pkgcheck/addons/git.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
from . import caches
3434

3535

36+
# ignore global user and system git config
37+
NO_CONFIG_ENV = ImmutableDict({'GIT_CONFIG_GLOBAL': '', 'GIT_CONFIG_SYSTEM': ''})
38+
39+
3640
@dataclass(frozen=True, eq=False)
3741
class GitCommit:
3842
"""Git commit objects."""
@@ -82,7 +86,7 @@ def __init__(self, cmd, path):
8286
self._running = False
8387
self.proc = subprocess.Popen(
8488
cmd, cwd=path,
85-
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
89+
stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=NO_CONFIG_ENV)
8690

8791
def __iter__(self):
8892
return self

0 commit comments

Comments
 (0)