@@ -59,6 +59,9 @@ def _date_formats(
59
59
Returns:
60
60
dict: Different date formats.
61
61
"""
62
+ assert time_zone is not None
63
+ assert locale is not None
64
+
62
65
utc_revision_date = datetime .utcfromtimestamp (int (unix_timestamp ))
63
66
loc_revision_date = utc_revision_date .replace (
64
67
tzinfo = get_timezone ("UTC" )
@@ -108,7 +111,7 @@ def get_git_commit_timestamp(
108
111
if is_first_commit :
109
112
# diff_filter="A" will select the commit that created the file
110
113
commit_timestamp = git .log (
111
- realpath , date = "short " , format = "%at" , diff_filter = "A"
114
+ realpath , date = "unix " , format = "%at" , diff_filter = "A"
112
115
)
113
116
# A file can be created multiple times, through a file renamed.
114
117
# Commits are ordered with most recent commit first
@@ -118,7 +121,7 @@ def get_git_commit_timestamp(
118
121
else :
119
122
# Latest commit touching a specific file
120
123
commit_timestamp = git .log (
121
- realpath , date = "short " , format = "%at" , n = 1
124
+ realpath , date = "unix " , format = "%at" , n = 1
122
125
)
123
126
except (InvalidGitRepositoryError , NoSuchPathError ) as err :
124
127
if self .config .get ('fallback_to_build_date' ):
@@ -190,7 +193,7 @@ def get_date_formats_for_timestamp(
190
193
"""
191
194
date_formats = self ._date_formats (
192
195
unix_timestamp = commit_timestamp ,
193
- time_zone = self .config .get ("time_zone " ),
196
+ time_zone = self .config .get ("timezone " ),
194
197
locale = self .config .get ("locale" )
195
198
)
196
199
if add_spans :
0 commit comments