Give status exec result variable a clearer name

This commit is contained in:
Tim Pope
2024-02-10 21:29:28 -05:00
parent 801b0417a5
commit 011cf4fcb9

View File

@@ -2737,7 +2737,7 @@ function! fugitive#BufReadStatus(cmdbang) abort
if !empty(tree) if !empty(tree)
let status_cmd = cmd + ['status', '-bz'] let status_cmd = cmd + ['status', '-bz']
call add(status_cmd, fugitive#GitVersion(2, 11) ? '--porcelain=v2' : '--porcelain') call add(status_cmd, fugitive#GitVersion(2, 11) ? '--porcelain=v2' : '--porcelain')
let status = fugitive#Execute(status_cmd, function('len')) let status_exec = fugitive#Execute(status_cmd, function('len'))
endif endif
doautocmd <nomodeline> BufReadPre doautocmd <nomodeline> BufReadPre
@@ -2748,15 +2748,15 @@ function! fugitive#BufReadStatus(cmdbang) abort
let [staged, unstaged, untracked] = [[], [], []] let [staged, unstaged, untracked] = [[], [], []]
let props = {} let props = {}
if !exists('status') if !exists('status_exec')
let branch = FugitiveHead(0, dir) let branch = FugitiveHead(0, dir)
let head = FugitiveHead(11, dir) let head = FugitiveHead(11, dir)
elseif fugitive#Wait(status).exit_status elseif fugitive#Wait(status_exec).exit_status
return 'echoerr ' . string('fugitive: ' . s:JoinChomp(status.stderr)) return 'echoerr ' . string('fugitive: ' . s:JoinChomp(status_exec.stderr))
elseif status.args[-1] ==# '--porcelain=v2' elseif status_exec.args[-1] ==# '--porcelain=v2'
let output = split(tr(join(status.stdout, "\1"), "\1\n", "\n\1"), "\1", 1)[0:-2] let output = split(tr(join(status_exec.stdout, "\1"), "\1\n", "\n\1"), "\1", 1)[0:-2]
let i = 0 let i = 0
while i < len(output) while i < len(output)
let line = output[i] let line = output[i]
@@ -2800,7 +2800,7 @@ function! fugitive#BufReadStatus(cmdbang) abort
endif endif
else else
let output = split(tr(join(status.stdout, "\1"), "\1\n", "\n\1"), "\1", 1)[0:-2] let output = split(tr(join(status_exec.stdout, "\1"), "\1\n", "\n\1"), "\1", 1)[0:-2]
while get(output, 0, '') =~# '^\l\+:' while get(output, 0, '') =~# '^\l\+:'
call remove(output, 0) call remove(output, 0)
endwhile endwhile