From b3b84194b2c46f11ec11e36e95aae2c8eb48174b Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Wed, 25 Nov 2009 15:26:53 -0800 Subject: [PATCH] gitcfg: Fix git-config usage for git 1.6.2 Certain versions of git are sensitive to the order of options passed to the git-config command. This ensures that --list is passed last. Signed-off-by: David Aguilar --- cola/gitcfg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cola/gitcfg.py b/cola/gitcfg.py index 2bc15570..34f7a585 100644 --- a/cola/gitcfg.py +++ b/cola/gitcfg.py @@ -71,7 +71,7 @@ class GitConfig(object): if git_path: bin_dir = os.path.dirname(git_path) prefix = os.path.dirname(bin_dir) - system_config = os.path.join(prefix, 'etc') + system_config = os.path.join(prefix, 'etc', 'gitconfig') if os.path.exists(system_config): self._config_files['system'] = system_config self._configs.append(system_config) @@ -132,8 +132,8 @@ class GitConfig(object): def read_config(self, path): """Return git config data from a path as a dictionary.""" dest = {} - opts = {'f': path, 'z': True, 'list': True} - config_lines = self.git.config(**opts).split('\0') + args = ('--null', '--file', path, '--list') + config_lines = self.git.config(*args).split('\0') for line in config_lines: try: k, v = line.split('\n') -- 2.11.4.GIT