mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 14:23:51 -05:00
Unstage single files from git move and do not move them back
This fixes #824
This commit is contained in:
@@ -975,11 +975,14 @@ function! s:StageToggle(lnum1,lnum2) abort
|
|||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
execute lnum
|
execute lnum
|
||||||
if filename =~ ' -> '
|
if section ==# 'staged'
|
||||||
let cmd = ['mv','--'] + reverse(split(filename,' -> '))
|
if filename =~ ' -> '
|
||||||
let filename = cmd[-1]
|
let files_to_unstage = split(filename,' -> ')
|
||||||
elseif section ==# 'staged'
|
else
|
||||||
let cmd = ['reset','-q','--',filename]
|
let files_to_unstage = [filename]
|
||||||
|
endif
|
||||||
|
let filename = files_to_unstage[-1]
|
||||||
|
let cmd = ['reset','-q','--'] + files_to_unstage
|
||||||
elseif getline(lnum) =~# '^#\tdeleted:'
|
elseif getline(lnum) =~# '^#\tdeleted:'
|
||||||
let cmd = ['rm','--',filename]
|
let cmd = ['rm','--',filename]
|
||||||
elseif getline(lnum) =~# '^#\tmodified:'
|
elseif getline(lnum) =~# '^#\tmodified:'
|
||||||
|
|||||||
Reference in New Issue
Block a user