From 7ef5b465cd5a3156f0dc2fcc914c2a92b2bf226a Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Thu, 27 Apr 2023 10:45:04 -0700 Subject: [PATCH] =?UTF-8?q?[SyncAnalysisState]=20Preserve=20synctime=20?= =?UTF-8?q?=C2=B5s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default, datetime.isoformat() uses different format depending on microseconds - if is equal to 0, microseconds are omitted, but otherwise not. Setting timespec = 'microseconds' ensures the format is the same regardless of current time. Change-Id: Icb1be31eb681247c7e46923cdeabb8f5469c20f0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/371694 Tested-by: Josip Sokcevic Reviewed-by: Joanna Wang Commit-Queue: Josip Sokcevic --- git_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git_config.py b/git_config.py index 05b3c1ee..87ed9765 100644 --- a/git_config.py +++ b/git_config.py @@ -792,7 +792,7 @@ class SyncAnalysisState: """ self._config = config now = datetime.datetime.utcnow() - self._Set("main.synctime", now.isoformat() + "Z") + self._Set("main.synctime", now.isoformat(timespec="microseconds") + "Z") self._Set("main.version", "1") self._Set("sys.argv", sys.argv) for key, value in superproject_logging_data.items():