mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 05:43:52 -05:00
Move FugitivePath() away from documented functions
This function has weird semantics and does not rise to the level of its peers.
This commit is contained in:
@@ -79,18 +79,6 @@ function! FugitiveFind(...) abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! FugitivePath(...) abort
|
|
||||||
if a:0 > 2 && type(a:1) ==# type({})
|
|
||||||
return fugitive#Path(a:2, a:3, FugitiveGitDir(a:1))
|
|
||||||
elseif a:0 && type(a:1) ==# type({})
|
|
||||||
return FugitiveReal(a:0 > 1 ? a:2 : @%)
|
|
||||||
elseif a:0 > 1
|
|
||||||
return fugitive#Path(a:1, a:2, FugitiveGitDir(a:0 > 2 ? a:3 : -1))
|
|
||||||
else
|
|
||||||
return FugitiveReal(a:0 ? a:1 : @%)
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" FugitiveParse() takes a fugitive:// URL and returns a 2 element list
|
" FugitiveParse() takes a fugitive:// URL and returns a 2 element list
|
||||||
" containing an object name ("commit:file") and the Git dir. It's effectively
|
" containing an object name ("commit:file") and the Git dir. It's effectively
|
||||||
" the inverse of FugitiveFind().
|
" the inverse of FugitiveFind().
|
||||||
@@ -209,6 +197,18 @@ function! FugitiveHead(...) abort
|
|||||||
return fugitive#Head(arg, dir)
|
return fugitive#Head(arg, dir)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! FugitivePath(...) abort
|
||||||
|
if a:0 > 2 && type(a:1) ==# type({})
|
||||||
|
return fugitive#Path(a:2, a:3, FugitiveGitDir(a:1))
|
||||||
|
elseif a:0 && type(a:1) ==# type({})
|
||||||
|
return FugitiveReal(a:0 > 1 ? a:2 : @%)
|
||||||
|
elseif a:0 > 1
|
||||||
|
return fugitive#Path(a:1, a:2, FugitiveGitDir(a:0 > 2 ? a:3 : -1))
|
||||||
|
else
|
||||||
|
return FugitiveReal(a:0 ? a:1 : @%)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! FugitiveStatusline(...) abort
|
function! FugitiveStatusline(...) abort
|
||||||
if empty(get(b:, 'git_dir', ''))
|
if empty(get(b:, 'git_dir', ''))
|
||||||
return ''
|
return ''
|
||||||
|
|||||||
Reference in New Issue
Block a user