From a65db6fcf8b18d6f2d545f9ea1268c538f13d9c9 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 14 Jan 2020 22:39:53 -0500 Subject: [PATCH] Move :Gmerge warning to top level function The old location isn't long for this world. --- autoload/fugitive.vim | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 5fad26d..724bc92 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -3677,14 +3677,7 @@ function! s:MergeRebase(cmd, bang, mods, args, ...) abort \ . "%+EXUNG \u0110\u1ed8T %.%#," \ . "%+E\u51b2\u7a81 %.%#," \ . 'U%\t%f' - if a:cmd =~# '^merge' && empty(args) && - \ (had_merge_msg || isdirectory(fugitive#Find('.git/rebase-apply', dir)) || - \ !empty(s:TreeChomp(dir, 'diff-files', '--diff-filter=U'))) - return 'echohl WarningMsg|echo ":Git merge for loading conflicts is deprecated in favor of :Git mergetool"|echohl NONE|silent Git' . (a:bang ? '!' : '') . ' mergetool' - let cmd = g:fugitive_git_executable.' diff-files --name-status --diff-filter=U' - else - let cmd = s:UserCommand(dir, argv) - endif + let cmd = s:UserCommand(dir, argv) if !empty($GIT_SEQUENCE_EDITOR) || has('win32') let old_sequence_editor = $GIT_SEQUENCE_EDITOR let $GIT_SEQUENCE_EDITOR = 'true' @@ -3774,6 +3767,13 @@ function! s:RebaseClean(file) abort endfunction function! s:MergeSubcommand(line1, line2, range, bang, mods, args) abort + let dir = s:Dir() + if empty(args) && ( + \ filereadable(fugitive#Find('.git/MERGE_MSG', dir)) || + \ isdirectory(fugitive#Find('.git/rebase-apply', dir)) || + \ !empty(s:TreeChomp(dir, 'diff-files', '--diff-filter=U'))) + return 'echohl WarningMsg|echo ":Git merge for loading conflicts is deprecated in favor of :Git mergetool"|echohl NONE|silent Git' . (a:bang ? '!' : '') . ' mergetool' + endif return s:MergeRebase('merge', a:bang, a:mods, a:args) endfunction