commit 98039f3349f3205c65de2c4458521ef8a8b189dc (tree)
parent 05a443cd6eba930a99992a768587d6c50e758df8
Author: Tim Pope <code@tpope.net>
Date: Fri, 20 Aug 2021 12:58:39 -0400
Move FugitivePath() away from documented functions
This function has weird semantics and does not rise to the level of its
peers.
Diffstat:
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim
@@ -79,18 +79,6 @@ function! FugitiveFind(...) abort
endif
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
" containing an object name ("commit:file") and the Git dir. It's effectively
" the inverse of FugitiveFind().
@@ -209,6 +197,18 @@ function! FugitiveHead(...) abort
return fugitive#Head(arg, dir)
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
if empty(get(b:, 'git_dir', ''))
return ''