From 441074f88139d39c8fd05bb56cbac78a7cbad81c Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 7 Jan 2019 10:23:02 -0500 Subject: [PATCH] Fix unstaging a deleted file Apparently the -- is mandatory if the file no longer exists. Closes https://github.com/tpope/vim-fugitive/issues/1161 --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 8475ecd..d6f49fd 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -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'