Handle status diff file arguments more rigorously

This commit is contained in:
Tim Pope
2023-09-18 11:15:36 -04:00
parent b9cf6ad994
commit 99db68d9b3

View File

@@ -2795,7 +2795,7 @@ function! fugitive#BufReadStatus(cmdbang) abort
let diff['Staged'] = fugitive#Execute(diff_cmd + ['--cached'], function('len')) let diff['Staged'] = fugitive#Execute(diff_cmd + ['--cached'], function('len'))
endif endif
if len(unstaged) if len(unstaged)
let diff['Unstaged'] = fugitive#Execute(diff_cmd + map(copy(unstaged), 'v:val.relative[0]'), function('len')) let diff['Unstaged'] = fugitive#Execute(diff_cmd + ['--'] + map(copy(unstaged), 'tree . "/" . v:val.relative[0]'), function('len'))
endif endif
for dict in staged for dict in staged