mirror of
https://github.com/github/semantic.git
synced 2024-12-25 16:02:43 +03:00
Return an empty Hunk in case there's no diff
This commit is contained in:
parent
291c66696c
commit
c9d8786347
@ -94,7 +94,7 @@ hunks diff blobs = hunksInRows (Both (1, 1)) . Prelude.fst $ splitDiffByLines di
|
||||
-- | patch.
|
||||
hunksInRows :: Both (Sum Int) -> [Row (SplitDiff a Info)] -> [Hunk (SplitDiff a Info)]
|
||||
hunksInRows start rows = case nextHunk start rows of
|
||||
Nothing -> []
|
||||
Nothing -> [Hunk { offset = Both (0, 0), changes = [], trailingContext = [] }]
|
||||
Just (hunk, rest) -> hunk : hunksInRows (offset hunk <> hunkLength hunk) rest
|
||||
|
||||
-- | Given beginning line numbers, return the next hunk and the remaining rows
|
||||
|
Loading…
Reference in New Issue
Block a user