Remove --intend-to-add from :Gstatus i

You can't actually apply a hunk to a file added with --intend-to-add, so
this did not pair well with the hunk expansion behavior.
This commit is contained in:
Tim Pope 2019-07-23 19:36:18 -04:00
parent d88a0f8465
commit 994d1b518f
2 changed files with 8 additions and 13 deletions

View File

@ -1808,7 +1808,7 @@ function! fugitive#BufReadStatus() abort
nnoremap <buffer> <silent> gr :<C-U>exe <SID>StageJump(v:count, 'Rebasing')<CR>
nnoremap <buffer> <silent> C :<C-U>Gcommit<CR>:echohl WarningMsg<Bar>echo ':Gstatus C is deprecated in favor of cc'<Bar>echohl NONE<CR>
nnoremap <buffer> <silent> a :<C-U>execute <SID>Do('Toggle',0)<CR>
nnoremap <buffer> <silent> i :<C-U>execute <SID>StageIntend(v:count1)<CR>
nnoremap <buffer> <silent> i :<C-U>execute <SID>NextExpandedHunk(v:count1)<CR>
exe 'nnoremap <buffer> <silent>' nowait "= :<C-U>execute <SID>StageInline('toggle',line('.'),v:count)<CR>"
exe 'nnoremap <buffer> <silent>' nowait "< :<C-U>execute <SID>StageInline('show', line('.'),v:count)<CR>"
exe 'nnoremap <buffer> <silent>' nowait "> :<C-U>execute <SID>StageInline('hide', line('.'),v:count)<CR>"
@ -2730,19 +2730,15 @@ function! s:StageInline(mode, ...) abort
return lnum
endfunction
function! s:StageIntend(count) abort
function! s:NextExpandedHunk(count) abort
for i in range(a:count)
if getline('.')[0:1] ==# '? '
call s:TreeChomp('add', '--intent-to-add', '--', s:Tree() . '/' . getline('.')[2:-1])
-
exe s:ReloadStatus()
elseif getline('.') =~# '^Unstaged\|^Untracked'
if getline('.') =~# '^Unstaged\|^Untracked'
call s:TreeChomp('add', '--intent-to-add', '--', s:Tree())
exe s:ReloadStatus()
else
call s:StageInline('show', line('.'), 1)
endif
call s:NextFileHunk(1)
call search('^[A-Z?] .\|^diff --\|^@','W')
endfor
return '.'
endfunction

View File

@ -270,11 +270,6 @@ X Discard the change under the cursor. This uses
*fugitive_>*
> Remove the inline diff of the file under the cursor.
*fugitive_i*
i On untracked files, call |:Git| add --intent-to-add.
Otherwise, move to next hunk, expanding inline diffs
automatically.
*fugitive_dd*
dd Perform a |:Gdiffsplit| on the file under the cursor.
@ -328,6 +323,10 @@ C Open the commit containing the current file.
) Jump to the next file or hunk.
<C-N>
*fugitive_i*
i Jump to the next file or hunk, expanding inline diffs
automatically.
*fugitive_[[*
[[ Jump to the previous section.