@@ -1026,24 +1026,24 @@ def load_branches():
10261026 values = line .split ("\t " )
10271027 if len (values ) != 3 : # invalid, shouldn't happen
10281028 continue
1029- b , sha , committer_unix_timestamp = values
1029+ b , sha , committer_unix_timestamp_and_time_zone = values
10301030 b_stripped = re .sub ("^refs/remotes/" , "" , b )
10311031 remote_branches_cached += [b_stripped ]
10321032 commit_sha_by_revision_cached [b ] = sha
1033- committer_unix_timestamp_by_revision_cached [b ] = int (committer_unix_timestamp .split (' ' )[0 ])
1033+ committer_unix_timestamp_by_revision_cached [b ] = int (committer_unix_timestamp_and_time_zone .split (' ' )[0 ])
10341034
10351035 raw_local = non_empty_lines (popen_git ("for-each-ref" , "--format=%(refname)\t %(objectname)\t %(committerdate:raw)\t %(upstream)" , "refs/heads" ))
10361036
10371037 for line in raw_local :
10381038 values = line .split ("\t " )
10391039 if len (values ) != 4 : # invalid, shouldn't happen
10401040 continue
1041- b , sha , committer_unix_timestamp , fetch_counterpart = values
1041+ b , sha , committer_unix_timestamp_and_time_zone , fetch_counterpart = values
10421042 b_stripped = re .sub ("^refs/heads/" , "" , b )
10431043 fetch_counterpart_stripped = re .sub ("^refs/remotes/" , "" , fetch_counterpart )
10441044 local_branches_cached += [b_stripped ]
10451045 commit_sha_by_revision_cached [b ] = sha
1046- committer_unix_timestamp_by_revision_cached [b ] = int (committer_unix_timestamp .split (' ' )[0 ])
1046+ committer_unix_timestamp_by_revision_cached [b ] = int (committer_unix_timestamp_and_time_zone .split (' ' )[0 ])
10471047 if fetch_counterpart_stripped in remote_branches_cached :
10481048 counterparts_for_fetching_cached [b_stripped ] = fetch_counterpart_stripped
10491049
@@ -1308,13 +1308,14 @@ def is_excluded_reflog_subject(sha_, gs_):
13081308
13091309
13101310def get_latest_checkout_timestamps ():
1311- # Entries are in the format '<branch_name>@{unix_timestamp}'
1311+ # Entries are in the format '<branch_name>@{< unix_timestamp> <time-zone> }'
13121312 result = {}
1313- # %gd - reflog selector (HEAD@{unix timestamp})
1313+ # %gd - reflog selector (HEAD@{<unix-timestamp> <time-zone>} for `--date=raw`;
1314+ # `--date=unix` is not available on some older versions of git)
13141315 # %gs - reflog subject
1315- output = popen_git ("reflog" , "show" , "--format=%gd:%gs" , "--date=unix " )
1316+ output = popen_git ("reflog" , "show" , "--format=%gd:%gs" , "--date=raw " )
13161317 for entry in non_empty_lines (output ):
1317- pattern = "^HEAD@\\ {([0-9]+)\\ }:checkout: moving from (.+) to (.+)$"
1318+ pattern = "^HEAD@\\ {([0-9]+) .+ \\ }:checkout: moving from (.+) to (.+)$"
13181319 match = re .search (pattern , entry )
13191320 if match :
13201321 from_branch = match .group (2 )
0 commit comments