Use fugitive:///c:/ instead of fugitive://c:/ on win32

This avoids a bogus use of the host field in a standard URL and matches
how file:// URLs work.
This commit is contained in:
Tim Pope
2022-06-26 15:22:18 -04:00
parent 00cc23868a
commit 9af6de1668

View File

@@ -137,7 +137,7 @@ endfunction
if exists('+shellslash') if exists('+shellslash')
let s:dir_commit_file = '\c^fugitive://\%(/\a\@=\)\=\(.\{-\}\)//\%(\(\x\{40,\}\|[0-3]\)\(/.*\)\=\)\=$' let s:dir_commit_file = '\c^fugitive://\%(/[^/]\@=\)\=\(.\{-\}\)//\%(\(\x\{40,\}\|[0-3]\)\(/.*\)\=\)\=$'
function! s:Slash(path) abort function! s:Slash(path) abort
return tr(a:path, '\', '/') return tr(a:path, '\', '/')
@@ -542,9 +542,16 @@ function! s:SameRepo(one, two) abort
return !empty(one) && one ==# s:GitDir(a:two) return !empty(one) && one ==# s:GitDir(a:two)
endfunction endfunction
function! s:DirUrlPrefix(...) abort if exists('+shellslash')
return 'fugitive://' . call('s:GitDir', a:000) . '//' function! s:DirUrlPrefix(...) abort
endfunction let gd = call('s:GitDir', a:000)
return 'fugitive://' . (gd =~# '^[^/]' ? '/' : '') . gd . '//'
endfunction
else
function! s:DirUrlPrefix(...) abort
return 'fugitive://' . call('s:GitDir', a:000) . '//'
endfunction
endif
function! s:Tree(...) abort function! s:Tree(...) abort
return a:0 ? FugitiveWorkTree(a:1) : FugitiveWorkTree() return a:0 ? FugitiveWorkTree(a:1) : FugitiveWorkTree()