File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,21 @@ def extract_jira_issue_key(message: str) -> Optional[str]:
3333def last_commit_datetime () -> datetime .datetime :
3434 # https://git-scm.com/docs/git-log#_pretty_formats
3535 author = run_command ('git config user.email' )
36- last_datetime = datetime .datetime .strptime (
37- run_command (
38- f'git log -1 --branches --format=%aI --author={ author } '
39- ).split ('+' )[0 ],
40- '%Y-%m-%dT%H:%M:%S' ) # %z
36+ last_author_stamp = run_command (
37+ f'git log -1 --branches --format=%aI --author={ author } '
38+ )
39+ if '+' in last_author_stamp :
40+ last_datetime = datetime .datetime .strptime (
41+ last_author_stamp .split ('+' )[0 ],
42+ '%Y-%m-%dT%H:%M:%S'
43+ ) # %z
44+ else :
45+ last_datetime = datetime .datetime .strptime (
46+ run_command (
47+ f'git log -1 --branches --format=%aI'
48+ ).split ('+' )[0 ],
49+ '%Y-%m-%dT%H:%M:%S'
50+ ) # %z
4151 return last_datetime
4252
4353
You can’t perform that action at this time.
0 commit comments