@@ -85,6 +85,8 @@ function Store:get_file_lines(file, status)
85
85
86
86
if file_status :has_both (' DU' ) then
87
87
err , lines = self .git :show (filename , ' :3' )
88
+ elseif file_status :has_both (' UD' ) then
89
+ err , lines = self .git :show (filename , ' :2' )
88
90
elseif file_status :has (' D ' ) then
89
91
err , lines = self .git :show (filename , ' HEAD' )
90
92
elseif status == ' staged' or file_status :has (' D' ) then
@@ -103,7 +105,9 @@ function Store:get_file_hunks(file, status, lines)
103
105
local hunks_err , hunks
104
106
105
107
if file_status :has_both (' DU' ) then
106
- hunks_err , hunks = self .git :unmerged_hunks (filename )
108
+ hunks_err , hunks = self .git :unmerged_hunks (filename , ' :3' , ' :1' )
109
+ elseif file_status :has_both (' UD' ) then
110
+ hunks_err , hunks = self .git :unmerged_hunks (filename , ' :1' , ' :2' )
107
111
elseif file_status :has_both (' ??' ) then
108
112
hunks = self .git :untracked_hunks (lines )
109
113
elseif file_status :has_either (' DD' ) then
@@ -228,7 +232,7 @@ function Store:get_diff_dto()
228
232
end
229
233
230
234
local file_status = file .status
231
- local is_deleted = not file_status :has_both (' DU' ) and file_status :has_either (' DD' )
235
+ local is_deleted = not ( file_status :has_both (' DU' ) or file_status : has_both ( ' UD ' ) ) and file_status :has_either (' DD' )
232
236
local diff_dto = diff_service :generate (hunks , lines , self .shape , { is_deleted = is_deleted })
233
237
234
238
self ._cache .diff_dtos [cache_key ] = diff_dto
0 commit comments