summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
authorIan Kasprzak <iankaz@google.com>2021-03-05 11:04:49 -0800
committerIan Kasprzak <iankaz@google.com>2021-03-08 17:32:09 +0000
commit835a34bdb911e15e228cb760043d3f737dd56c84 (patch)
tree2152ffa9a3aa2ccb878ca2d92d67775a36de555f /git_config.py
parentef99ec07b4687cef0129057b81c0c1ebd21bb640 (diff)
downloadgit-repo-835a34bdb911e15e228cb760043d3f737dd56c84.tar.gz
Log repo.* config variables in git trace2 logger.
Bug: [google internal] b/181758736 Testing: - Unit tests - Verified repo git trace2 logs had expected data Change-Id: I9af8a574377bd91115f085808c1271e9dee16a36 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/299182 Tested-by: Ian Kasprzak <iankaz@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Raman Tenneti <rtenneti@google.com>
Diffstat (limited to 'git_config.py')
-rw-r--r--git_config.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/git_config.py b/git_config.py
index 282c0802..914b2924 100644
--- a/git_config.py
+++ b/git_config.py
@@ -145,6 +145,21 @@ class GitConfig(object):
145 except ValueError: 145 except ValueError:
146 return None 146 return None
147 147
148 def DumpConfigDict(self):
149 """Returns the current configuration dict.
150
151 Configuration data is information only (e.g. logging) and
152 should not be considered a stable data-source.
153
154 Returns:
155 dict of {<key>, <value>} for git configuration cache.
156 <value> are strings converted by GetString.
157 """
158 config_dict = {}
159 for key in self._cache:
160 config_dict[key] = self.GetString(key)
161 return config_dict
162
148 def GetBoolean(self, name): 163 def GetBoolean(self, name):
149 """Returns a boolean from the configuration file. 164 """Returns a boolean from the configuration file.
150 None : The value was not defined, or is not a boolean. 165 None : The value was not defined, or is not a boolean.