mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-08 21:47:45 +00:00
fix: git diff blob excerpt (#38808)
1. refactor the legacy code and add more comments, remove the "+1/-1" tricks, clarify the BuildBlobExcerptDiffSection behavior 2. fix a line-counting bug (see screenshot below)
This commit is contained in:
@@ -98,8 +98,8 @@ func TestGetDiffForRender(t *testing.T) {
|
||||
ExpandDirection: "down",
|
||||
LastLeftIdx: 76,
|
||||
LastRightIdx: 73,
|
||||
LeftIdx: 104,
|
||||
RightIdx: 101,
|
||||
LeftIdx: 103, // left has 103 lines
|
||||
RightIdx: 100, // right has 100 lines
|
||||
},
|
||||
}
|
||||
for idx, exp := range expectedSections {
|
||||
|
||||
Reference in New Issue
Block a user