Pass absolute paths through FugitiveGenerate() unchanged

This is designed to exclude traditional paths, URLs, and also Vim
constructs like zipfile:c:\foo.zip::file.
This commit is contained in:
Tim Pope
2018-07-28 16:51:17 -04:00
parent da066426fd
commit deaf4aa139
3 changed files with 9 additions and 5 deletions

View File

@@ -159,6 +159,9 @@ function! FugitivePath(...) abort
endfunction
function! FugitiveGenerate(...) abort
if a:0 && s:shellslash(a:0) =~# '^\%(\a\a\+:\)\=\%(a:\)\=/\|^[~$]'
return a:1
endif
return fugitive#repo(a:0 > 1 ? a:2 : get(b:, 'git_dir', '')).translate(a:0 ? a:1 : '', 1)
endfunction