(ref #2145)Fix patch output

This commit is contained in:
Naoki Takezoe
2018-09-22 09:29:37 +09:00
parent 6061f70e24
commit 126a3465d6

View File

@@ -613,8 +613,12 @@ object JGitUtil {
df.setRepository(git.getRepository)
df.setDiffComparator(RawTextComparator.DEFAULT)
df.setDetectRenames(true)
df.format(getDiffEntries(git, from, to).head)
new String(out.toByteArray, "UTF-8")
getDiffEntries(git, from, to)
.map { entry =>
df.format(entry)
new String(out.toByteArray, "UTF-8")
}
.mkString("\n")
}
private def getDiffEntries(git: Git, from: Option[String], to: String): Seq[DiffEntry] = {