Return '' for FugitiveRoute('')

This commit is contained in:
Tim Pope 2018-08-19 17:49:45 -04:00
parent ed36717a68
commit ae2005adbb
2 changed files with 3 additions and 3 deletions

View File

@ -508,7 +508,7 @@ function! fugitive#Route(object, ...) abort
let prefix = matchstr(a:object, '^[~$]\i*')
let owner = expand(prefix)
return s:PlatformSlash((len(owner) ? owner : prefix) . strpart(a:object, len(prefix)))
elseif s:Slash(a:object) =~# '^/\|^\%(\a\a\+:\).*\%(//\|::\)' || (has('win32') ? '^\a:/' : '')
elseif s:Slash(a:object) =~# '^$\|^/\|^\%(\a\a\+:\).*\%(//\|::\)' . (has('win32') ? '\|^\a:/' : '')
return s:PlatformSlash(a:object)
elseif s:Slash(a:object) =~# '^\.\.\=\%(/\|$\)'
return s:PlatformSlash(simplify(getcwd() . '/' . a:object))
@ -534,7 +534,7 @@ function! fugitive#Route(object, ...) abort
else
let f = dir . f
endif
elseif rev =~# '^$\|^:/$'
elseif rev ==# ':/'
let f = base
elseif rev =~# '^\.\%(/\|$\)'
let f = base . rev[1:-1]

View File

@ -44,7 +44,7 @@ function! FugitiveReal(...) abort
endfunction
function! FugitiveRoute(...) abort
return fugitive#Route(a:0 ? a:1 : '', FugitiveGitDir(a:0 > 1 ? a:2 : -1))
return fugitive#Route(a:0 ? a:1 : ':/', FugitiveGitDir(a:0 > 1 ? a:2 : -1))
endfunction
function! FugitivePath(...) abort