summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
authorJosip Sokcevic <sokcevic@google.com>2023-04-27 10:45:04 -0700
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-27 20:19:34 +0000
commit7ef5b465cd5a3156f0dc2fcc914c2a92b2bf226a (patch)
tree20d5593e62c8416bfd71e845962571e26305961b /git_config.py
parente7e20f4686e1be6a3914df0a5ec60c7d32ba8775 (diff)
downloadgit-repo-7ef5b465cd5a3156f0dc2fcc914c2a92b2bf226a.tar.gz
[SyncAnalysisState] Preserve synctime µs
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 <sokcevic@google.com> Reviewed-by: Joanna Wang <jojwang@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Diffstat (limited to 'git_config.py')
-rw-r--r--git_config.py2
1 files changed, 1 insertions, 1 deletions
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:
792 """ 792 """
793 self._config = config 793 self._config = config
794 now = datetime.datetime.utcnow() 794 now = datetime.datetime.utcnow()
795 self._Set("main.synctime", now.isoformat() + "Z") 795 self._Set("main.synctime", now.isoformat(timespec="microseconds") + "Z")
796 self._Set("main.version", "1") 796 self._Set("main.version", "1")
797 self._Set("sys.argv", sys.argv) 797 self._Set("sys.argv", sys.argv)
798 for key, value in superproject_logging_data.items(): 798 for key, value in superproject_logging_data.items():