File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -396,6 +396,7 @@ let g:vim_project_config.git_local_changes_mappings = {
396396 \'pull': 'u',
397397 \'push': 'p',
398398 \'pull_and_push': 'P',
399+ \'force_push': 'F',
399400 \}
400401```
401402
Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ function! s:Prepare()
143143 \' pull' : ' u ',
144144 \' push' : ' p ',
145145 \' pull_and_push' : ' P ',
146+ \' force_push' : ' F',
146147 \' shelf' : ' s ',
147148 \' unshelf' : ' S ',
148149 \}
Original file line number Diff line number Diff line change @@ -1519,6 +1519,7 @@ function! s:SetupChangelistBuffer()
15191519 call s: AddMapping (mappings.pull, ' <SID>TryPull()' )
15201520 call s: AddMapping (mappings.push, ' <SID>TryPush()' )
15211521 call s: AddMapping (mappings.pull_and_push, ' <SID>TryPullThenPush()' )
1522+ call s: AddMapping (mappings.force_push, ' <SID>TryPush(1)' )
15221523 call s: AddMapping (mappings.new_changelist, ' <SID>NewChangelistFolder()' )
15231524 call s: AddMapping (mappings.move_to_changelist, ' <SID>MoveToFolder()' )
15241525 call s: AddVisualMapping (mappings.move_to_changelist, ' <SID>MoveToFolder()' )
@@ -1686,9 +1687,9 @@ function! s:TryCommit()
16861687 nnoremap <buffer> <silent> p :call <SID> TryPullThenPush()<cr>
16871688endfunction
16881689
1689- function ! s: TryPush ()
1690- call project#Info (' Pushing...' )
1691- let cmd = ' git push'
1690+ function ! s: TryPush (force = 0 )
1691+ call project#Info (a: force ? ' Force pushing... ' : ' Pushing...' )
1692+ let cmd = a: force ? ' git push -f ' : ' git push'
16921693 let result = project#RunShellCmd (cmd)
16931694 if v: shell_error
16941695 return
You can’t perform that action at this time.
0 commit comments