Add default core.askPass to :Gpull
This commit is contained in:
parent
511e32114b
commit
d7172882b7
@ -3482,8 +3482,22 @@ function! s:MergeRebase(cmd, bang, mods, args, ...) abort
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let [mp, efm] = [&l:mp, &l:efm]
|
||||
let had_merge_msg = filereadable(fugitive#Find('.git/MERGE_MSG', dir))
|
||||
let argv = s:UserCommandList(dir)
|
||||
if a:cmd ==# 'pull'
|
||||
let argv += s:AskPassArgs(dir) + ['pull', '--progress']
|
||||
else
|
||||
call add(argv, a:cmd)
|
||||
endif
|
||||
if !s:HasOpt(args, '--no-edit', '--abort', '-m') && a:cmd !=# 'rebase'
|
||||
call add(argv, '--edit')
|
||||
endif
|
||||
if a:cmd ==# 'rebase' && s:HasOpt(args, '--autosquash') && !s:HasOpt(args, '--interactive', '-i')
|
||||
call add(argv, '--interactive')
|
||||
endif
|
||||
call extend(argv, args)
|
||||
|
||||
let [mp, efm] = [&l:mp, &l:efm]
|
||||
try
|
||||
let cdback = s:Cd(s:Tree(dir))
|
||||
let &l:errorformat = ''
|
||||
@ -3510,30 +3524,28 @@ function! s:MergeRebase(cmd, bang, mods, args, ...) abort
|
||||
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')))
|
||||
let &l:makeprg = g:fugitive_git_executable.' diff-files --name-status --diff-filter=U'
|
||||
let cmd = g:fugitive_git_executable.' diff-files --name-status --diff-filter=U'
|
||||
else
|
||||
let &l:makeprg = s:sub(s:UserCommand() . ' ' . a:cmd .
|
||||
\ (s:HasOpt(args, '--no-edit', '--abort', '-m') || a:cmd =~# '^rebase' ? '' : ' --edit') .
|
||||
\ (s:HasOpt(args, '--autosquash') && a:cmd =~# '^rebase' ? ' --interactive' : '') .
|
||||
\ ' ' . s:shellesc(args), ' *$', '')
|
||||
let cmd = s:shellesc(argv)
|
||||
endif
|
||||
if !empty($GIT_SEQUENCE_EDITOR) || has('win32')
|
||||
let old_sequence_editor = $GIT_SEQUENCE_EDITOR
|
||||
let $GIT_SEQUENCE_EDITOR = 'true'
|
||||
else
|
||||
let &l:makeprg = 'env GIT_SEQUENCE_EDITOR=true ' . &l:makeprg
|
||||
let cmd = 'env GIT_SEQUENCE_EDITOR=true ' . cmd
|
||||
endif
|
||||
if !empty($GIT_EDITOR) || has('win32')
|
||||
let old_editor = $GIT_EDITOR
|
||||
let $GIT_EDITOR = 'false'
|
||||
else
|
||||
let &l:makeprg = 'env GIT_EDITOR=false ' . substitute(&l:makeprg, '^env ', '', '')
|
||||
let cmd = 'env GIT_EDITOR=false ' . substitute(cmd, '^env ', '', '')
|
||||
endif
|
||||
if !has('patch-8.1.0334') && has('terminal') && &autowrite
|
||||
let autowrite_was_set = 1
|
||||
set noautowrite
|
||||
silent! wall
|
||||
endif
|
||||
let &l:makeprg = cmd
|
||||
silent noautocmd make!
|
||||
catch /^Vim\%((\a\+)\)\=:E211/
|
||||
let err = v:exception
|
||||
@ -3613,7 +3625,7 @@ function! s:RebaseSubcommand(line1, line2, range, bang, mods, args) abort
|
||||
endfunction
|
||||
|
||||
function! s:PullSubcommand(line1, line2, range, bang, mods, args) abort
|
||||
return s:MergeRebase('pull --progress', a:bang, a:mods, a:args)
|
||||
return s:MergeRebase('pull', a:bang, a:mods, a:args)
|
||||
endfunction
|
||||
|
||||
augroup fugitive_merge
|
||||
|
Loading…
Reference in New Issue
Block a user