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>
diff --git a/git_config.py b/git_config.py
index 282c080..914b292 100644
--- a/git_config.py
+++ b/git_config.py
@@ -145,6 +145,21 @@
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 {<key>, <value>} for git configuration cache.
+ <value> 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.