mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	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>
This commit is contained in:
		@@ -75,7 +75,11 @@
 | 
				
			|||||||
							<pre class="commit-body" style="display: none;">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
 | 
												<pre class="commit-body" style="display: none;">{{RenderCommitBody $.Context .Message $commitRepoLink $.Repository.ComposeMetas}}</pre>
 | 
				
			||||||
							{{end}}
 | 
												{{end}}
 | 
				
			||||||
						</td>
 | 
											</td>
 | 
				
			||||||
						<td class="text right aligned">{{TimeSince .Author.When $.Lang}}</td>
 | 
											{{if .Committer}}
 | 
				
			||||||
 | 
												<td class="text right aligned">{{TimeSince .Committer.When $.Lang}}</td>
 | 
				
			||||||
 | 
											{{else}}
 | 
				
			||||||
 | 
												<td class="text right aligned">{{TimeSince .Author.When $.Lang}}</td>
 | 
				
			||||||
 | 
											{{end}}
 | 
				
			||||||
					</tr>
 | 
										</tr>
 | 
				
			||||||
				{{end}}
 | 
									{{end}}
 | 
				
			||||||
			</tbody>
 | 
								</tbody>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,7 +34,7 @@
 | 
				
			|||||||
					</span>
 | 
										</span>
 | 
				
			||||||
				{{end}}
 | 
									{{end}}
 | 
				
			||||||
			</th>
 | 
								</th>
 | 
				
			||||||
			<th class="text grey right age">{{if .LatestCommit}}{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}{{end}}</th>
 | 
								<th class="text grey right age">{{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When $.Lang}}{{end}}{{end}}</th>
 | 
				
			||||||
		</tr>
 | 
							</tr>
 | 
				
			||||||
	</thead>
 | 
						</thead>
 | 
				
			||||||
	<tbody>
 | 
						<tbody>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user