From a1f9596d2d884e74358bc5017a73f37e34f7b04c Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 26 Dec 2018 16:23:33 -0500 Subject: [PATCH] Add mods support to :Gmerge --- autoload/fugitive.vim | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 9eb2922..d121db4 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2285,11 +2285,11 @@ endfunction " Section: :Gmerge, :Grebase, :Gpull call s:command("-nargs=? -bang -complete=custom,s:RevisionComplete Gmerge " . - \ "execute s:Merge('merge', 0, )") + \ "execute s:Merge('merge', 0, '', )") call s:command("-nargs=? -bang -complete=custom,s:RevisionComplete Grebase " . - \ "execute s:Merge('rebase', 0, )") + \ "execute s:Merge('rebase', 0, '', )") call s:command("-nargs=? -bang -complete=custom,s:RemoteComplete Gpull " . - \ "execute s:Merge('pull --progress', 0, )") + \ "execute s:Merge('pull --progress', 0, '', )") function! s:RevisionComplete(A, L, P) abort return s:TreeChomp('rev-parse', '--symbolic', '--branches', '--tags', '--remotes') @@ -2327,7 +2327,8 @@ let s:common_efm = '' \ . '%-G%.%#%\e[K%.%#,' \ . '%-G%.%#%\r%.%\+' -function! s:Merge(cmd, bang, args) abort +function! s:Merge(cmd, bang, mods, args) abort + let mods = substitute(a:mods, '\C', '', '') . ' ' if a:cmd =~# '^rebase' && ' '.a:args =~# ' -i\| --interactive\| --edit-todo' return 'echoerr "git rebase --interactive not supported"' endif @@ -2385,7 +2386,7 @@ function! s:Merge(cmd, bang, args) abort if empty(filter(getqflist(),'v:val.valid')) if !had_merge_msg && filereadable(b:git_dir . '/MERGE_MSG') cclose - return 'Gcommit --no-status -n -t '.s:shellesc(b:git_dir . '/MERGE_MSG') + return mods . 'Gcommit --no-status -n -t '.s:shellesc(b:git_dir . '/MERGE_MSG') endif endif let qflist = getqflist()