Fix status reload after staging entire section

Resolves: https://github.com/tpope/vim-fugitive/issues/1912
This commit is contained in:
Tim Pope
2021-12-29 16:48:37 -05:00
parent ee992c808c
commit b1c3cdffc9

View File

@@ -5139,11 +5139,14 @@ function! s:StagePatch(lnum1,lnum2) abort
for lnum in range(a:lnum1,a:lnum2) for lnum in range(a:lnum1,a:lnum2)
let info = s:StageInfo(lnum) let info = s:StageInfo(lnum)
if empty(info.paths) && info.section ==# 'Staged' if empty(info.paths) && info.section ==# 'Staged'
return 'tab Git reset --patch' execute 'tab Git reset --patch'
break
elseif empty(info.paths) && info.section ==# 'Unstaged' elseif empty(info.paths) && info.section ==# 'Unstaged'
return 'tab Git add --patch' execute 'tab Git add --patch'
break
elseif empty(info.paths) && info.section ==# 'Untracked' elseif empty(info.paths) && info.section ==# 'Untracked'
return 'tab Git add --interactive' execute 'tab Git add --interactive'
break
elseif empty(info.paths) elseif empty(info.paths)
continue continue
endif endif