commit a65db6fcf8b18d6f2d545f9ea1268c538f13d9c9 (tree)
parent 305337a9c1c204da2b782271e7b65ae0648402d3
Author: Tim Pope <code@tpope.net>
Date: Tue, 14 Jan 2020 22:39:53 -0500
Move :Gmerge warning to top level function
The old location isn't long for this world.
Diffstat:
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git 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