Fix issue generating Fugitive URLs

This commit is contained in:
Tim Pope
2018-07-22 01:57:39 -04:00
parent 71acb7da35
commit 4a5781bc1b

View File

@@ -343,7 +343,7 @@ function! s:repo_translate(spec, ...) dict abort
endif
if !exists('f')
let commit = substitute(matchstr(rev,'^[^:]\+\|^:.*'), '^@\%($|[^~]\)\@=', 'HEAD', '')
let file = substitute(matchstr(rev, '^[^:]\+:.*'), '^:', '/', '')
let file = substitute(matchstr(rev, '^[^:]\+\zs:.*'), '^:', '/', '')
if commit !~# '^[0-9a-f]\{40\}$'
let commit = system(fugitive#Prepare(dir, 'rev-parse', '--verify', commit))[0:-2]
let commit = v:shell_error ? '' : commit