mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 05:43:52 -05:00
Fix :Gedit worktree-file
Closes https://github.com/tpope/vim-fugitive/issues/1679 References https://github.com/tpope/vim-fugitive/issues/1667
This commit is contained in:
@@ -1010,8 +1010,15 @@ function! fugitive#Find(object, ...) abort
|
||||
endif
|
||||
if commit !~# '^[0-9a-f]\{40,\}$'
|
||||
let commit = matchstr(s:ChompDefault('', [dir, 'rev-parse', '--verify', commit . (len(file) ? '^{}' : ''), '--']), '\<[0-9a-f]\{40,\}\>')
|
||||
if empty(commit) && len(file)
|
||||
let commit = repeat('0', 40)
|
||||
endif
|
||||
endif
|
||||
if len(commit)
|
||||
let f = 'fugitive://' . dir . '//' . commit . file
|
||||
else
|
||||
let f = base . '/' . substitute(rev, '^:/:\=\|^[^:]\+:', '', '')
|
||||
endif
|
||||
let f = 'fugitive://' . dir . '//' . (len(commit) ? commit : repeat('0', 40)) . file
|
||||
endif
|
||||
endif
|
||||
return FugitiveVimPath(f)
|
||||
|
||||
Reference in New Issue
Block a user