mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-09 20:13:46 -05:00
Give precedence to absolute paths over pseudo-relative
I was planning on phasing out support for /path to access a file in the root of the repo slowly, but life gets simpler if we can count on absolute paths always working as expected.
This commit is contained in:
@@ -543,7 +543,7 @@ function! s:Generate(rev, ...) abort
|
|||||||
let dir = a:0 ? a:1 : get(b:, 'git_dir', '')
|
let dir = a:0 ? a:1 : get(b:, 'git_dir', '')
|
||||||
let tree = s:Tree(dir)
|
let tree = s:Tree(dir)
|
||||||
let object = a:rev
|
let object = a:rev
|
||||||
if a:rev =~# '^/' && len(tree) && (getftime(tree . a:rev) >= 0 || getftime(a:rev) < 0) || a:rev =~# '^/\.git\%(/\|$\)'
|
if a:rev =~# '^/' && len(tree) && getftime(tree . a:rev) >= 0 && getftime(a:rev) < 0 || a:rev =~# '^/\.git\%(/\|$\)'
|
||||||
let object = '.' . object
|
let object = '.' . object
|
||||||
endif
|
endif
|
||||||
return fugitive#Route(object, dir)
|
return fugitive#Route(object, dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user