-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Munged text leads to incorrect diffs #140
Comments
Here's a rough test case:
|
I sent out #141 to revert the implementation to the limited, but not incorrect, rune approach. Some more fundamental changes would probably be preferable if someone has more time to work on it. |
Ran into this as well. I don't need to diff large chunks (context: #89 (comment)) so I downgraded to v1.1.0, which seems to be, still to this day, widely used (i.e. go-git). |
Is there any progress on this issue? |
db1b095 introduces a bug in its change from
diffLinesToRunesMunge
todiffLinesToStringsMunge
. Since each line is represented by 1 or more ascii characters, it's possible for the diffing algorithm to split hashed lines incorrectly whereas before the rune indexed lines were indivisible.For instance,
DiffLinesToChars
could return hashed strings such as:DiffMain
may then split the leading42
such as:And the resulting diff after hydration is completely wrong.
This affects users of the
DiffLinesTo*
APIs as well as any user that passestrue
forchecklines
inDiffMain
orDiffMainRunes
.The text was updated successfully, but these errors were encountered: