mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 13:53:51 -05:00
Always use Git style path for <C-R><C-G>
This commit is contained in:
@@ -970,17 +970,20 @@ function! fugitive#Object(...) abort
|
|||||||
let rev = ''
|
let rev = ''
|
||||||
endif
|
endif
|
||||||
let tree = s:Tree(dir)
|
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)
|
if empty(rev) && empty(tree)
|
||||||
|
return FugitiveGitPath(full)
|
||||||
elseif empty(rev)
|
elseif empty(rev)
|
||||||
let rev = fugitive#Path(a:0 ? a:1 : @%, './', dir)
|
let rev = fugitive#Path(full, './', dir)
|
||||||
if rev =~# '^\./.git\%(/\|$\)'
|
if rev =~# '^\./.git\%(/\|$\)'
|
||||||
return fnamemodify(a:0 ? a:1 : @%, ':p' . (rev =~# '/$' ? '' : ':s?/$??'))
|
return FugitiveGitPath(full)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if rev !~# '^\.\%(/\|$\)' || s:cpath(getcwd(), tree)
|
if rev !~# '^\.\%(/\|$\)' || s:cpath(getcwd(), tree)
|
||||||
return rev
|
return rev
|
||||||
else
|
else
|
||||||
return tree . rev[1:-1]
|
return FugitiveGitPath(tree . rev[1:-1])
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user