File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 118118
119119--- @param target_layout Layout
120120function FileEntry :convert_layout (target_layout )
121+ if not self .revs then return end
122+
121123 local get_data
122124
123125 for _ , file in ipairs (self .layout :files ()) do
Original file line number Diff line number Diff line change 11local FileEntry = require (" diffview.scene.file_entry" ).FileEntry
2+ local Diff2Hor = require (" diffview.scene.layouts.diff_2_hor" ).Diff2Hor
23local RevType = require (" diffview.vcs.rev" ).RevType
34local GitRev = require (" diffview.vcs.adapters.git.rev" ).GitRev
45
56describe (" diffview.file_entry" , function ()
7+ it (" convert_layout skips null entries without error (#612)" , function ()
8+ local adapter = { ctx = { toplevel = vim .uv .cwd () } }
9+ local entry = FileEntry .new_null_entry (adapter )
10+ local original_layout = entry .layout
11+
12+ -- Must not error; null entries have no revs.
13+ assert .has_no .errors (function ()
14+ entry :convert_layout (Diff2Hor )
15+ end )
16+
17+ assert .are .equal (original_layout , entry .layout )
18+ end )
19+
620 it (" does not treat should_null errors as truthy null markers" , function ()
721 local captured
822 local layout_class = setmetatable ({
You can’t perform that action at this time.
0 commit comments