mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-09 12:03:47 -05:00
Call Gcommit on Grebase --continue
On a rebase instruction that should result in an immediate commit, the quickfix list will be closed and Gcommit will be called.
This commit is contained in:
@@ -2293,6 +2293,13 @@ function! s:RemoteComplete(A, L, P) abort
|
|||||||
return join(matches, "\n")
|
return join(matches, "\n")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:HasRebaseCommitCmd() abort
|
||||||
|
if !filereadable(b:git_dir . '/rebase-merge/amend') || !filereadable(b:git_dir . '/rebase-merge/done')
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
return get(readfile(b:git_dir . '/rebase-merge/done'), -1, '') =~# '^[^e]'
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! fugitive#Cwindow() abort
|
function! fugitive#Cwindow() abort
|
||||||
if &buftype == 'quickfix'
|
if &buftype == 'quickfix'
|
||||||
cwindow
|
cwindow
|
||||||
@@ -2330,6 +2337,7 @@ function! s:Merge(cmd, bang, mods, args) abort
|
|||||||
\ . '%+ECannot %.%#: Your index contains uncommitted changes.,'
|
\ . '%+ECannot %.%#: Your index contains uncommitted changes.,'
|
||||||
\ . '%+EThere is no tracking information for the current branch.,'
|
\ . '%+EThere is no tracking information for the current branch.,'
|
||||||
\ . '%+EYou are not currently on a branch. Please specify which,'
|
\ . '%+EYou are not currently on a branch. Please specify which,'
|
||||||
|
\ . '%+I%.%#git rebase --continue,'
|
||||||
\ . 'CONFLICT (%m): %f deleted in %.%#,'
|
\ . 'CONFLICT (%m): %f deleted in %.%#,'
|
||||||
\ . 'CONFLICT (%m): Merge conflict in %f,'
|
\ . 'CONFLICT (%m): Merge conflict in %f,'
|
||||||
\ . 'CONFLICT (%m): Rename \"%f\"->%.%#,'
|
\ . 'CONFLICT (%m): Rename \"%f\"->%.%#,'
|
||||||
@@ -2368,10 +2376,13 @@ function! s:Merge(cmd, bang, mods, args) abort
|
|||||||
execute cdback
|
execute cdback
|
||||||
endtry
|
endtry
|
||||||
call fugitive#ReloadStatus()
|
call fugitive#ReloadStatus()
|
||||||
if empty(filter(getqflist(),'v:val.valid'))
|
if empty(filter(getqflist(),'v:val.valid && v:val.type !=# "I"'))
|
||||||
if !had_merge_msg && filereadable(b:git_dir . '/MERGE_MSG')
|
if !had_merge_msg && filereadable(b:git_dir . '/MERGE_MSG')
|
||||||
cclose
|
cclose
|
||||||
return mods . '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')
|
||||||
|
elseif a:cmd =~# '^rebase' && ' '.a:args =~# ' --continue' && s:HasRebaseCommitCmd()
|
||||||
|
cclose
|
||||||
|
return mods . 'Gcommit --amend'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
let qflist = getqflist()
|
let qflist = getqflist()
|
||||||
|
|||||||
Reference in New Issue
Block a user