commit 4e85dd342467fd8a9ec51aa162fae1b6e737a89e (tree)
parent 0508885550b7709e89d976c434b4c2a6a5caaf05
Author: Tim Pope <code@tpope.net>
Date: Thu, 18 Mar 2021 21:06:56 -0400
Revert "Support X for submodules"
I should have looked closer because because I didn't realize "Support X
for submodules" meant "make it do something completely unrelated".
This reverts commit a21ca7e86e0daf8246db791c0084086b87cdc586.
References https://github.com/tpope/vim-fugitive/issues/1705
Diffstat:
1 file changed, 5 insertions(+), 20 deletions(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -1789,12 +1789,12 @@ function! fugitive#BufReadStatus() abort
else
let files = file
endif
- let sub = matchstr(line, '^[12u] .. \zs....')
if line[2] !=# '.'
- call add(staged, {'type': 'File', 'status': line[2], 'filename': files, 'sub': sub})
+ call add(staged, {'type': 'File', 'status': line[2], 'filename': files})
endif
if line[3] !=# '.'
- call add(unstaged, {'type': 'File', 'status': get({'C':'M','M':'?','U':'?'}, matchstr(sub, 'S\.*\zs[CMU]'), line[3]), 'filename': file, 'sub': sub})
+ let sub = matchstr(line, '^[12u] .. \zs....')
+ call add(unstaged, {'type': 'File', 'status': get({'C':'M','M':'?','U':'?'}, matchstr(sub, 'S\.*\zs[CMU]'), line[3]), 'filename': file})
endif
endif
let i += 1
@@ -1844,12 +1844,12 @@ function! fugitive#BufReadStatus() abort
let i += 1
endif
if line[0] !~# '[ ?!#]'
- call add(staged, {'type': 'File', 'status': line[0], 'filename': files, 'sub': ''})
+ call add(staged, {'type': 'File', 'status': line[0], 'filename': files})
endif
if line[0:1] ==# '??'
call add(untracked, {'type': 'File', 'status': line[1], 'filename': files})
elseif line[1] !~# '[ !#]'
- call add(unstaged, {'type': 'File', 'status': line[1], 'filename': file, 'sub': ''})
+ call add(unstaged, {'type': 'File', 'status': line[1], 'filename': file})
endif
endwhile
endif
@@ -3053,7 +3053,6 @@ function! s:StageInfo(...) abort
\ 'paths': map(reverse(split(text, ' -> ')), 's:Tree() . "/" . v:val'),
\ 'commit': matchstr(getline(lnum), '^\%(\%(\x\x\x\)\@!\l\+\s\+\)\=\zs[0-9a-f]\{4,\}\ze '),
\ 'status': matchstr(getline(lnum), '^[A-Z?]\ze \|^\%(\x\x\x\)\@!\l\+\ze [0-9a-f]'),
- \ 'sub': get(get(get(b:fugitive_files, section, {}), text, {}), 'sub', ''),
\ 'index': index}
endfunction
@@ -3619,20 +3618,6 @@ function! s:StageDelete(lnum1, lnum2, count) abort
if empty(info.paths)
continue
endif
- let sub = get(get(get(b:fugitive_files, info.section, {}), info.filename, {}), 'sub')
- if sub =~# '^S'
- if info.status ==# 'A'
- continue
- endif
- if info.section ==# 'Staged'
- call s:TreeChomp('reset', '--', info.paths[0])
- endif
- if info.status =~# '[MD]'
- call s:TreeChomp('submodule', 'update', '--', info.paths[0])
- call add(restore, ':Git -C ' . info.relative[0] . ' checkout -')
- endif
- continue
- endif
if info.status ==# 'D'
let undo = 'GRemove'
elseif info.paths[0] =~# '/$'