From 7ea21ca9acfadb1a9197ef28d6f40689cc30b42e Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 10 Aug 2018 15:58:09 -0400 Subject: [PATCH] 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. --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 08292b1..edd307c 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -543,7 +543,7 @@ function! s:Generate(rev, ...) abort let dir = a:0 ? a:1 : get(b:, 'git_dir', '') let tree = s:Tree(dir) 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 endif return fugitive#Route(object, dir)