From d7c85b1c0156672ebb6810e99631e8ae1652cd62 Mon Sep 17 00:00:00 2001
From: Jerome Reybert <jreybert@gmail.com>
Date: Fri, 30 Oct 2015 23:54:50 +0100
Subject: [PATCH] plugin/magit.vim: fix stage_block discard

---
 plugin/magit.vim | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugin/magit.vim b/plugin/magit.vim
index 43e0c21..8607817 100644
--- a/plugin/magit.vim
+++ b/plugin/magit.vim
@@ -706,19 +706,19 @@ function! magit#stage_block(selection, discard) abort
 				call magit#git#git_unapply(header, a:selection, 'staged')
 			endif
 		else
-			echoerr "Must be in \"" . 
-						\ g:magit_sections.staged . "\" or \"" . 
+			echoerr "Must be in \"" .
+						\ g:magit_sections.staged . "\" or \"" .
 						\ g:magit_sections.unstaged . "\" section"
 		endif
 	else
 		if ( section == 'unstaged' )
 			if ( file.must_be_added() )
-				call delete(filename)
+				call magit#git#git_checkout(magit#utils#add_quotes(filename))
 			else
 				call magit#git#git_unapply(header, a:selection, 'unstaged')
 			endif
 		else
-			echoerr "Must be in \"" . 
+			echoerr "Must be in \"" .
 						\ g:magit_sections.unstaged . "\" section"
 		endif
 	endif
-- 
GitLab