|
|
|
@ -3489,7 +3489,7 @@ function! s:FinishCommit() abort |
|
|
|
|
call setbufvar(buf, 'fugitive_commit_arguments', []) |
|
|
|
|
if getbufvar(buf, 'fugitive_commit_rebase') |
|
|
|
|
call setbufvar(buf, 'fugitive_commit_rebase', 0) |
|
|
|
|
let s:rebase_continue = s:Dir(buf) |
|
|
|
|
let s:rebase_continue = [s:Dir(buf), 0] |
|
|
|
|
endif |
|
|
|
|
return s:CommitSubcommand(-1, -1, 0, 0, '', args, s:Dir(buf)) |
|
|
|
|
endif |
|
|
|
@ -3696,11 +3696,11 @@ function! s:MergeRebase(cmd, bang, mods, args, ...) abort |
|
|
|
|
call fugitive#ReloadStatus(dir, 1) |
|
|
|
|
if empty(filter(getqflist(),'v:val.valid && v:val.type !=# "I"')) |
|
|
|
|
if a:cmd =~# '^rebase' && |
|
|
|
|
\ filereadable(fugitive#Find('.git/rebase-merge/amend', dir)) && |
|
|
|
|
\ filereadable(fugitive#Find('.git/rebase-merge/done', dir)) && |
|
|
|
|
\ get(readfile(fugitive#Find('.git/rebase-merge/done', dir)), -1, '') =~# '^[^e]' |
|
|
|
|
\ get(readfile(fugitive#Find('.git/rebase-merge/done', dir)), -1, '') =~# '^[^bep]' |
|
|
|
|
cclose |
|
|
|
|
return 'exe ' . string(mods . 'Gcommit --amend -n -F ' . s:fnameescape(fugitive#Find('.git/rebase-merge/message', dir)) . ' -e') . '|let b:fugitive_commit_rebase = 1' |
|
|
|
|
let amend = filereadable(fugitive#Find('.git/rebase-merge/amend', dir)) ? '--amend ' : '' |
|
|
|
|
return 'exe ' . string(mods . 'Gcommit ' . amend . '-n -F ' . s:fnameescape(fugitive#Find('.git/rebase-merge/message', dir)) . ' -e') . '|let b:fugitive_commit_rebase = 1' |
|
|
|
|
elseif !had_merge_msg && filereadable(fugitive#Find('.git/MERGE_MSG', dir)) |
|
|
|
|
cclose |
|
|
|
|
return mods . 'Gcommit --no-status -n -t '.s:fnameescape(fugitive#Find('.git/MERGE_MSG', dir)) |
|
|
|
@ -3758,18 +3758,27 @@ function! s:PullSubcommand(line1, line2, range, bang, mods, args) abort |
|
|
|
|
return s:MergeRebase('pull', a:bang, a:mods, a:args) |
|
|
|
|
endfunction |
|
|
|
|
|
|
|
|
|
function! s:RebaseContinue(arg, ...) abort |
|
|
|
|
let [dir, edit_todo] = a:arg |
|
|
|
|
exe s:MergeRebase('rebase', 0, '', [edit_todo && getfsize(fugitive#Find('.git/rebase-merge/git-rebase-todo', dir)) <= 0 ? '--abort' : '--continue'], dir) |
|
|
|
|
endfunction |
|
|
|
|
|
|
|
|
|
augroup fugitive_merge |
|
|
|
|
autocmd! |
|
|
|
|
autocmd VimLeavePre,BufDelete git-rebase-todo |
|
|
|
|
\ if getbufvar(+expand('<abuf>'), '&bufhidden') ==# 'wipe' | |
|
|
|
|
\ call s:RebaseClean(expand('<afile>')) | |
|
|
|
|
\ if getfsize(FugitiveFind('.git/rebase-merge/done', +expand('<abuf>'))) == 0 | |
|
|
|
|
\ let s:rebase_continue = FugitiveGitDir(+expand('<abuf>')) | |
|
|
|
|
\ let s:rebase_continue = [FugitiveGitDir(+expand('<abuf>')), 1] | |
|
|
|
|
\ endif | |
|
|
|
|
\ endif |
|
|
|
|
autocmd BufEnter * nested |
|
|
|
|
\ if exists('s:rebase_continue') | |
|
|
|
|
\ exe s:MergeRebase('rebase', 0, '', [getfsize(fugitive#Find('.git/rebase-merge/git-rebase-todo', s:rebase_continue)) > 0 ? '--continue' : '--abort'], remove(s:, 'rebase_continue')) | |
|
|
|
|
\ if has('timers') | |
|
|
|
|
\ call timer_start(0, function('s:RebaseContinue', [remove(s:, 'rebase_continue')])) | |
|
|
|
|
\ else | |
|
|
|
|
\ call s:RebaseContinue(remove(s:, 'rebase_continue')) | |
|
|
|
|
\ endif | |
|
|
|
|
\ endif |
|
|
|
|
augroup END |
|
|
|
|
|
|
|
|
@ -4393,7 +4402,7 @@ endfunction |
|
|
|
|
|
|
|
|
|
function! s:AskPassArgs(dir) abort |
|
|
|
|
if (len($DISPLAY) || len($TERM_PROGRAM) || has('gui_running')) && fugitive#GitVersion(1, 8) && |
|
|
|
|
\ empty($GIT_ASKPASS) && empty($SSH_ASKPASS) && empty(fugitive#Config('core.askPass', a:dir)) |
|
|
|
|
\ empty($GIT_ASKPASS) && empty($SSH_ASKPASS) && empty(get(fugitive#Config(a:dir), 'core.askpass', [])) |
|
|
|
|
if s:executable(s:ExecPath() . '/git-gui--askpass') |
|
|
|
|
return ['-c', 'core.askPass=' . s:ExecPath() . '/git-gui--askpass'] |
|
|
|
|
elseif s:executable('ssh-askpass') |
|
|
|
|