Fix diff expansion is missing final line in a file (#16222)

* Fixed down offset.

* Fixed wrong line count result.
这个提交包含在:
KN4CK3R
2021-06-24 17:47:46 +02:00
提交者 GitHub
父节点 71c5a8f7f8
当前提交 4cc63e9919
修改 2 个文件,包含 13 行新增4 行删除
+5 -1
查看文件
@@ -714,7 +714,11 @@ func ExcerptBlob(ctx *context.Context) {
lastLeft += chunkSize
lastRight += chunkSize
} else {
section.Lines, err = getExcerptLines(commit, filePath, lastLeft, lastRight, idxRight-lastRight-1)
offset := -1
if direction == "down" {
offset = 0
}
section.Lines, err = getExcerptLines(commit, filePath, lastLeft, lastRight, idxRight-lastRight+offset)
leftHunkSize = 0
rightHunkSize = 0
idxLeft = lastLeft