From 835a34bdb911e15e228cb760043d3f737dd56c84 Mon Sep 17 00:00:00 2001 From: Ian Kasprzak Date: Fri, 5 Mar 2021 11:04:49 -0800 Subject: 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 Reviewed-by: Mike Frysinger Reviewed-by: Raman Tenneti --- git_config.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'git_config.py') 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): except ValueError: return None + def DumpConfigDict(self): + """Returns the current configuration dict. + + Configuration data is information only (e.g. logging) and + should not be considered a stable data-source. + + Returns: + dict of {, } for git configuration cache. + are strings converted by GetString. + """ + config_dict = {} + for key in self._cache: + config_dict[key] = self.GetString(key) + return config_dict + def GetBoolean(self, name): """Returns a boolean from the configuration file. None : The value was not defined, or is not a boolean. -- cgit v1.2.3-54-g00ecf