Skip to content

Commit 43c6b27

Browse files
Gustedzeripathlunny
authored
Fix commit's time (#18375)
* Fix commit's time - Use the Committer's `when` as the CommitDate will be modified when the commit is being moved around in the git tree(e.g. being rebased on top of newer commits). The Author's `when` is created once and never touched again. * Update templates/repo/view_list.tmpl * Commmt unstaged * Add fallback Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 parent 9837773 commit 43c6b27

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

templates/repo/commits_list.tmpl

+5-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@
7575
<pre class="commit-body" style="display: none;">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
7676
{{end}}
7777
</td>
78-
<td class="text right aligned">{{TimeSince .Author.When $.Lang}}</td>
78+
{{if .Committer}}
79+
<td class="text right aligned">{{TimeSince .Committer.When $.Lang}}</td>
80+
{{else}}
81+
<td class="text right aligned">{{TimeSince .Author.When $.Lang}}</td>
82+
{{end}}
7983
</tr>
8084
{{end}}
8185
</tbody>

templates/repo/view_list.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</span>
3535
{{end}}
3636
</th>
37-
<th class="text grey right age">{{if .LatestCommit}}{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}{{end}}</th>
37+
<th class="text grey right age">{{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When $.Lang}}{{end}}{{end}}</th>
3838
</tr>
3939
</thead>
4040
<tbody>

0 commit comments

Comments
 (0)