Handle FugitiveReal('') correctly
This commit is contained in:
parent
c5d4ce7479
commit
4643363b08
@ -511,7 +511,7 @@ function! fugitive#Real(url) abort
|
||||
let tree = FugitiveTreeForGitDir(dir)
|
||||
return s:PlatformSlash((len(tree) ? tree : dir) . file)
|
||||
endif
|
||||
let url = fnamemodify(a:url, ':p' . (a:url =~# '[\/]$' ? '' : ':s?[\/]$??'))
|
||||
let url = len(url) ? fnamemodify(a:url, ':p' . (a:url =~# '[\/]$' ? '' : ':s?[\/]$??')) : ''
|
||||
if url =~# '^[\\/]\|^\a:[\\/]'
|
||||
return s:PlatformSlash(url)
|
||||
endif
|
||||
@ -519,7 +519,7 @@ function! fugitive#Real(url) abort
|
||||
endfunction
|
||||
|
||||
function! fugitive#Path(url, ...) abort
|
||||
if !a:0
|
||||
if !a:0 || empty(a:url)
|
||||
return fugitive#Real(a:url)
|
||||
endif
|
||||
let url = s:shellslash(fnamemodify(a:url, ':p'))
|
||||
|
@ -143,7 +143,7 @@ function! FugitiveReal(...) abort
|
||||
let file = a:0 ? a:1 : @%
|
||||
if file =~? '^fugitive:' || a:0 > 1
|
||||
return call('fugitive#Real', [file] + a:000[1:-1])
|
||||
elseif file =~# '^/\|^\a\+:'
|
||||
elseif file =~# '^/\|^\a\+:\|^$'
|
||||
return file
|
||||
else
|
||||
return fnamemodify(file, ':p' . (file =~# '[\/]$' ? '' : ':s?[\/]$??'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user