commit 7ea21ca9acfadb1a9197ef28d6f40689cc30b42e (tree)
parent 2ca0765dc4ce1520c38c796990f9bd99a51cb351
Author: Tim Pope <code@tpope.net>
Date: Fri, 10 Aug 2018 15:58:09 -0400
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.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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)