Skip to content

Fix make_diff with zero context requested #2070

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

Merged
merged 5 commits into from
Oct 26, 2017

Conversation

jugglerchris
Copy link
Contributor

While working on #1173, I found that calling make_diff with context_size of 0 didn't work properly (or at least not as I expected!): it sometimes includes a Context line (I think in the first Mismatch) and splits a contiguous chunk of changed lines into separate Mismatches.

I'm not completely convinced about what it does with context_size>0 and two changes closer than that together; it splits it into two Mismatch items after the context lines between them. The Unix diff command merges them together. In any case, I don't think I've changed how that behaves.

@nrc nrc merged commit 985aa2b into rust-lang:master Oct 26, 2017
@nrc
Copy link
Member

nrc commented Oct 26, 2017

Looks good, thanks! And love the tests :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants