Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix bug expanding large-diff-gated patches with comments #2007
Description of the Change
Once upon a time, there was a bug where clicking "expand" on a file patch that exceeded the large diff gate size, that had comments, would throw a stacktrace. Sadness!
@vanessayuenn and I determined that the root cause of this bug was that because large patches are initially collapsed, we were never populating the red and black tree used to keep track of the diff offset indices for comment placement.
Solution was to extract a function to populate the diff offset indices, and then call that function when expanding file patches.
Users can now expand large-diff-gated file patches that contain comments without errors and sadness. (Well, I can't guarantee there will be no sadness.)
Can't think of any drawbacks but if you can, I'm open to discussion.
Added one code comment like a champ.
This bug is for a feature that hasn't been released yet so I'm ok leaving it out of the release notes.
User Experience Research (Optional)
@@ Coverage Diff @@ ## master #2007 +/- ## ========================================== - Coverage 92.58% 92.58% -0.01% ========================================== Files 189 189 Lines 11237 11244 +7 Branches 1633 1634 +1 ========================================== + Hits 10404 10410 +6 - Misses 833 834 +1
kuychaco left a comment
Thanks for putting in this fix so quickly! It looks good
Just left a couple of comments -- one suggestion and one question about a potential edge case. But I think neither of them are necessarily ship-blocking.