mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 22:33:51 -05:00
@@ -739,14 +739,16 @@ function! s:stage_info(lnum) abort
|
||||
endwhile
|
||||
if !lnum
|
||||
return ['', '']
|
||||
elseif getline(lnum+1) =~# '^# .*\<git \%(reset\|rm --cached\) ' || getline(lnum) ==# '# Changes to be committed:'
|
||||
elseif (getline(lnum+1) =~# '^# .*\<git \%(reset\|rm --cached\) ' && getline(lnum+2) ==# '#') || getline(lnum) ==# '# Changes to be committed:'
|
||||
return [matchstr(filename, colon.' *\zs.*'), 'staged']
|
||||
elseif (getline(lnum+1) =~# '^# .*\<git add ' && getline(lnum+2) ==# '#') || getline(lnum) ==# '# Untracked files:'
|
||||
return [filename, 'untracked']
|
||||
elseif getline(lnum+2) =~# '^# .*\<git checkout ' || getline(lnum) ==# '# Changes not staged for commit:'
|
||||
return [matchstr(filename, colon.' *\zs.*'), 'unstaged']
|
||||
elseif getline(lnum+1) =~# '^# .*\<git add/rm ' || getline(lnum) ==# '# Unmerged paths:'
|
||||
elseif getline(lnum+2) =~# '^# .*\<git \%(add\|rm\)' || getline(lnum) ==# '# Unmerged paths:'
|
||||
return [matchstr(filename, colon.' *\zs.*'), 'unmerged']
|
||||
else
|
||||
return [filename, 'untracked']
|
||||
return ['', 'unknown']
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user