From c9d4ea7900c3821288f1b5a0d77a2864f0e9990a Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 3 Sep 2019 23:08:50 -0400 Subject: [PATCH] Always use Git style path for --- autoload/fugitive.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index ac21b82..2bc7b14 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -970,17 +970,20 @@ function! fugitive#Object(...) abort let rev = '' endif let tree = s:Tree(dir) + let full = a:0 ? a:1 : @% + let full = fnamemodify(full, ':p' . (s:Slash(full) =~# '/$' ? '' : ':s?/$??')) if empty(rev) && empty(tree) + return FugitiveGitPath(full) elseif empty(rev) - let rev = fugitive#Path(a:0 ? a:1 : @%, './', dir) + let rev = fugitive#Path(full, './', dir) if rev =~# '^\./.git\%(/\|$\)' - return fnamemodify(a:0 ? a:1 : @%, ':p' . (rev =~# '/$' ? '' : ':s?/$??')) + return FugitiveGitPath(full) endif endif if rev !~# '^\.\%(/\|$\)' || s:cpath(getcwd(), tree) return rev else - return tree . rev[1:-1] + return FugitiveGitPath(tree . rev[1:-1]) endif endfunction