mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-09 12:03:47 -05:00
Handle empty items when null splitting
This correctly handles the case of multiple consecutive nulls (which I don't think Git every produces in practice) and also the case of a bogus newline at the end (which seems to happen with PowerShell). References https://github.com/tpope/vim-fugitive/pull/1783
This commit is contained in:
@@ -553,7 +553,13 @@ endfunction
|
|||||||
|
|
||||||
function! s:NullError(...) abort
|
function! s:NullError(...) abort
|
||||||
let [out, exec_error] = s:SystemError(call('fugitive#Prepare', a:000))
|
let [out, exec_error] = s:SystemError(call('fugitive#Prepare', a:000))
|
||||||
return [exec_error ? [] : split(out, "\1"), exec_error ? substitute(out, "\n$", "", "") : '', exec_error]
|
if exec_error
|
||||||
|
return [[], substitute(out, "\n$", "", "") : '', exec_error]
|
||||||
|
else
|
||||||
|
let list = split(out, "\1", 1)
|
||||||
|
call remove(list, -1)
|
||||||
|
return [list, '', exec_error]
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:TreeChomp(...) abort
|
function! s:TreeChomp(...) abort
|
||||||
|
|||||||
Reference in New Issue
Block a user