mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-17 06:42:52 +02:00
Fix git diff hunk 0 based start line
This commit is contained in:
parent
b46623f6a5
commit
decc9624b7
@ -864,9 +864,9 @@ func parseHunks(ctx context.Context, curFile *DiffFile, maxLines, maxLineCharact
|
||||
}
|
||||
curSection.Lines = append(curSection.Lines, diffLine)
|
||||
curSection.FileName = curFile.Name
|
||||
// update line number.
|
||||
leftLine = lineSectionInfo.LeftIdx
|
||||
rightLine = lineSectionInfo.RightIdx
|
||||
// update line number. leftLine and rightLine are 1-based indexes, 0 means 1
|
||||
leftLine = max(lineSectionInfo.LeftIdx, 1)
|
||||
rightLine = max(lineSectionInfo.RightIdx, 1)
|
||||
continue
|
||||
case '\\':
|
||||
if maxLines > -1 && curFileLinesCount >= maxLines {
|
||||
|
Loading…
x
Reference in New Issue
Block a user