mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 05:13:53 -05:00
Support ...commit as HEAD...commit
This commit is contained in:
@@ -914,8 +914,8 @@ function! fugitive#Find(object, ...) abort
|
|||||||
let f = 'fugitive://' . dir . '//0/' . rev[1:-1]
|
let f = 'fugitive://' . dir . '//0/' . rev[1:-1]
|
||||||
else
|
else
|
||||||
if !exists('f')
|
if !exists('f')
|
||||||
let commit = substitute(matchstr(rev, '^[^:.-][^:]*\|^:.*'), '^@\%($\|[~^]\|@{\)\@=', 'HEAD', '')
|
let commit = substitute(matchstr(rev, '^\%([^:.-]\|\.\.[^/:]\)[^:]*\|^:.*'), '^@\%($\|[~^]\|@{\)\@=', 'HEAD', '')
|
||||||
let file = substitute(matchstr(rev, '^[^:.-][^:]*\zs:.*'), '^:', '/', '')
|
let file = substitute(matchstr(rev, '^\%([^:.-]\|\.\.[^/:]\)[^:]*\zs:.*'), '^:', '/', '')
|
||||||
if file =~# '^/\.\.\=\%(/\|$\)\|^//\|^/\a\+:'
|
if file =~# '^/\.\.\=\%(/\|$\)\|^//\|^/\a\+:'
|
||||||
let file = file =~# '^/\.' ? simplify(getcwd() . file) : file[1:-1]
|
let file = file =~# '^/\.' ? simplify(getcwd() . file) : file[1:-1]
|
||||||
if s:cpath(base . '/', (file . '/')[0 : len(base)])
|
if s:cpath(base . '/', (file . '/')[0 : len(base)])
|
||||||
|
|||||||
Reference in New Issue
Block a user