Fix unstaging a deleted file

Apparently the -- is mandatory if the file no longer exists.

Closes https://github.com/tpope/vim-fugitive/issues/1161
This commit is contained in:
Tim Pope 2019-01-07 10:23:02 -05:00
parent 68cd7ecf71
commit 441074f881

View File

@ -2349,7 +2349,7 @@ function! s:StageToggle(lnum1, count) abort
if info.section ==# 'Staged'
let files_to_unstage = split(filename, ' -> ')
let filename = files_to_unstage[-1]
let cmd = ['reset', '-q'] + map(copy(files_to_unstage), '"./" . v:val')
let cmd = ['reset', '-q', '--'] + map(copy(files_to_unstage), 's:Tree() . "/" . v:val')
elseif getline(lnum) =~# '^D'
let cmd = ['rm', './' . filename]
elseif getline(lnum) =~# '^M'