mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 05:25:50 +01:00
Display parent commit id at the commit details page.
This commit is contained in:
@@ -52,10 +52,13 @@ object JGitUtil {
|
||||
* @param committer the commiter name
|
||||
* @param shortMessage the short message
|
||||
* @param fullMessage the full message
|
||||
* @param parents the list of parent commid id
|
||||
*/
|
||||
case class CommitInfo(id: String, time: Date, committer: String, shortMessage: String, fullMessage: String){
|
||||
def this(rev: org.eclipse.jgit.revwalk.RevCommit) =
|
||||
this(rev.getName, rev.getCommitterIdent.getWhen, rev.getCommitterIdent.getName, rev.getShortMessage, rev.getFullMessage)
|
||||
case class CommitInfo(id: String, time: Date, committer: String, shortMessage: String, fullMessage: String, parents: List[String]){
|
||||
|
||||
def this(rev: org.eclipse.jgit.revwalk.RevCommit) = this(
|
||||
rev.getName, rev.getCommitterIdent.getWhen, rev.getCommitterIdent.getName, rev.getShortMessage, rev.getFullMessage,
|
||||
rev.getParents().map(_.name).toList)
|
||||
|
||||
val description = {
|
||||
val i = fullMessage.trim.indexOf("\n")
|
||||
|
||||
@@ -22,7 +22,21 @@
|
||||
<td>
|
||||
<a href="@path/@commit.committer" class="username">@commit.committer</a> <span class="description">@helpers.datetime(commit.time)</span>
|
||||
<div class="pull-right align-right monospace small">
|
||||
@if(commit.parents.size == 0){
|
||||
<span class="description">0 parent</span>
|
||||
}
|
||||
@if(commit.parents.size == 1){
|
||||
<span class="description">1 parent</span>
|
||||
<a href="@path/@repository.owner/@repository.name/commit/@commit.parents(0)" class="commit-id">@commit.parents(0).substring(0, 7)</a>
|
||||
}
|
||||
<span class="description">commit</span> @commit.id
|
||||
@if(commit.parents.size > 1){
|
||||
<br>
|
||||
<span class="description">@commit.parents.size parent</span>
|
||||
@commit.parents.map { parent =>
|
||||
@parent
|
||||
}.mkString(" + ")
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user