Skip to content
Commit 6790469f authored by Brandon Maier's avatar Brandon Maier Committed by Chris Lamb
Browse files

Fix missing diff output on large diffs.

When there is a large diff chunk, match_lines() will skip running the
difflib.Differ.compare(). However this causes the following issues:

- It does not empty the `self.buf` buffer. This means that all future
  calls to match_lines() for that file will always be too large. So
  effectively no more diffs from the file get output.

- It outputs a debug message, but does not output anything to the
  side-by-side diff, so a user looking at the side-by-side diff may be
  misled into thinking the rest of the file has no differences.

We can fix these issue by falling back to a lazy line-by-line diff. This
produces suboptimal output, but it runs in linear O(n) time while
providing some form of output. We include a comment in the diff so the
user knows the following output is using a lazy diff algorithm.
parent 3ab6acb8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment