diff options
Diffstat (limited to 'git_config.py')
-rw-r--r-- | git_config.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/git_config.py b/git_config.py index 978f6a59..3eaf201c 100644 --- a/git_config.py +++ b/git_config.py | |||
@@ -65,6 +65,15 @@ class GitConfig(object): | |||
65 | 65 | ||
66 | _USER_CONFIG = '~/.gitconfig' | 66 | _USER_CONFIG = '~/.gitconfig' |
67 | 67 | ||
68 | _ForSystem = None | ||
69 | _SYSTEM_CONFIG = '/etc/gitconfig' | ||
70 | |||
71 | @classmethod | ||
72 | def ForSystem(cls): | ||
73 | if cls._ForSystem is None: | ||
74 | cls._ForSystem = cls(configfile=cls._SYSTEM_CONFIG) | ||
75 | return cls._ForSystem | ||
76 | |||
68 | @classmethod | 77 | @classmethod |
69 | def ForUser(cls): | 78 | def ForUser(cls): |
70 | if cls._ForUser is None: | 79 | if cls._ForUser is None: |
@@ -356,7 +365,10 @@ class GitConfig(object): | |||
356 | return c | 365 | return c |
357 | 366 | ||
358 | def _do(self, *args): | 367 | def _do(self, *args): |
359 | command = ['config', '--file', self.file, '--includes'] | 368 | if self.file == self._SYSTEM_CONFIG: |
369 | command = ['config', '--system', '--includes'] | ||
370 | else: | ||
371 | command = ['config', '--file', self.file, '--includes'] | ||
360 | command.extend(args) | 372 | command.extend(args) |
361 | 373 | ||
362 | p = GitCommand(None, | 374 | p = GitCommand(None, |