mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 21:45:50 +01:00
Fix commit log.
This commit is contained in:
@@ -212,8 +212,10 @@ object JGitUtil {
|
|||||||
@scala.annotation.tailrec
|
@scala.annotation.tailrec
|
||||||
def getCommitLog(i: java.util.Iterator[RevCommit], count: Int, logs: List[CommitInfo]): (List[CommitInfo], Boolean) =
|
def getCommitLog(i: java.util.Iterator[RevCommit], count: Int, logs: List[CommitInfo]): (List[CommitInfo], Boolean) =
|
||||||
i.hasNext match {
|
i.hasNext match {
|
||||||
case true if(limit <= 0 || logs.size < limit) =>
|
case true if(limit <= 0 || logs.size < limit) => {
|
||||||
getCommitLog(i, count + 1, if(limit <= 0 || (fixedPage - 1) * limit < count) logs :+ new CommitInfo(i.next) else logs)
|
val commit = i.next
|
||||||
|
getCommitLog(i, count + 1, if(limit <= 0 || (fixedPage - 1) * limit <= count) logs :+ new CommitInfo(commit) else logs)
|
||||||
|
}
|
||||||
case _ => (logs, i.hasNext)
|
case _ => (logs, i.hasNext)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,16 +314,18 @@ object JGitUtil {
|
|||||||
}
|
}
|
||||||
treeWalk.release
|
treeWalk.release
|
||||||
} else {
|
} else {
|
||||||
val parent = revWalk.parseCommit(commit.getParent(0).getId())
|
(0 to commit.getParentCount - 1).foreach { i =>
|
||||||
val df = new DiffFormatter(DisabledOutputStream.INSTANCE)
|
val parent = revWalk.parseCommit(commit.getParent(i).getId())
|
||||||
df.setRepository(git.getRepository)
|
val df = new DiffFormatter(DisabledOutputStream.INSTANCE)
|
||||||
df.setDiffComparator(RawTextComparator.DEFAULT)
|
df.setRepository(git.getRepository)
|
||||||
df.setDetectRenames(true)
|
df.setDiffComparator(RawTextComparator.DEFAULT)
|
||||||
val diffs = df.scan(parent.getTree(), commit.getTree)
|
df.setDetectRenames(true)
|
||||||
diffs.asScala.foreach { diff =>
|
val diffs = df.scan(parent.getTree(), commit.getTree)
|
||||||
paths.foreach { path =>
|
diffs.asScala.foreach { diff =>
|
||||||
if(diff.getChangeType != ChangeType.DELETE && diff.getNewPath.startsWith(path) && !map.contains(path)){
|
paths.foreach { path =>
|
||||||
map.put(path, commit)
|
if(diff.getChangeType != ChangeType.DELETE && diff.getNewPath.startsWith(path) && !map.contains(path)){
|
||||||
|
map.put(path, commit)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user