Remove FugitiveGenerate() in favor of FugitiveFind()
This commit is contained in:
parent
2845e6dc4f
commit
0fd64f8fbf
@ -400,19 +400,19 @@ function! s:repo_bare() dict abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:repo_route(object) dict abort
|
function! s:repo_find(object) dict abort
|
||||||
return fugitive#Route(a:object, self.git_dir)
|
return fugitive#Find(a:object, self.git_dir)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:repo_translate(rev) dict abort
|
function! s:repo_translate(rev) dict abort
|
||||||
return s:Slash(fugitive#Route(substitute(a:rev, '^/', ':(top)', ''), self.git_dir))
|
return s:Slash(fugitive#Find(substitute(a:rev, '^/', ':(top)', ''), self.git_dir))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:repo_head(...) dict abort
|
function! s:repo_head(...) dict abort
|
||||||
return fugitive#Head(a:0 ? a:1 : 0, self.git_dir)
|
return fugitive#Head(a:0 ? a:1 : 0, self.git_dir)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call s:add_methods('repo',['dir','tree','bare','route','translate','head'])
|
call s:add_methods('repo',['dir','tree','bare','find','translate','head'])
|
||||||
|
|
||||||
function! s:repo_prepare(...) dict abort
|
function! s:repo_prepare(...) dict abort
|
||||||
return call('fugitive#Prepare', [self.git_dir] + a:000)
|
return call('fugitive#Prepare', [self.git_dir] + a:000)
|
||||||
@ -581,7 +581,7 @@ function! s:Relative(...) abort
|
|||||||
return fugitive#Path(@%, a:0 ? a:1 : ':(top)')
|
return fugitive#Path(@%, a:0 ? a:1 : ':(top)')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fugitive#Route(object, ...) abort
|
function! fugitive#Find(object, ...) abort
|
||||||
if type(a:object) == type(0)
|
if type(a:object) == type(0)
|
||||||
let name = bufname(a:object)
|
let name = bufname(a:object)
|
||||||
return s:PlatformSlash(name =~# '^$\|^/\|^\a\+:' ? name : getcwd() . '/' . name)
|
return s:PlatformSlash(name =~# '^$\|^/\|^\a\+:' ? name : getcwd() . '/' . name)
|
||||||
@ -638,7 +638,7 @@ function! fugitive#Route(object, ...) abort
|
|||||||
else
|
else
|
||||||
let altdir = FugitiveExtractGitDir(f)
|
let altdir = FugitiveExtractGitDir(f)
|
||||||
if len(altdir) && !s:cpath(dir, altdir)
|
if len(altdir) && !s:cpath(dir, altdir)
|
||||||
return fugitive#Route(a:object, altdir)
|
return fugitive#Find(a:object, altdir)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
elseif rev =~# '^:[0-3]:'
|
elseif rev =~# '^:[0-3]:'
|
||||||
@ -670,7 +670,7 @@ function! fugitive#Route(object, ...) abort
|
|||||||
else
|
else
|
||||||
let altdir = FugitiveExtractGitDir(file)
|
let altdir = FugitiveExtractGitDir(file)
|
||||||
if len(altdir) && !s:cpath(dir, altdir)
|
if len(altdir) && !s:cpath(dir, altdir)
|
||||||
return fugitive#Route(a:object, altdir)
|
return fugitive#Find(a:object, altdir)
|
||||||
endif
|
endif
|
||||||
return file
|
return file
|
||||||
endif
|
endif
|
||||||
@ -698,7 +698,7 @@ function! s:Generate(rev, ...) abort
|
|||||||
elseif a:rev =~# '^/' && len(tree) && getftime(tree . a:rev) >= 0 && getftime(a:rev) < 0
|
elseif a:rev =~# '^/' && len(tree) && getftime(tree . a:rev) >= 0 && getftime(a:rev) < 0
|
||||||
let object = ':(top)' . a:rev[1:-1]
|
let object = ':(top)' . a:rev[1:-1]
|
||||||
endif
|
endif
|
||||||
return fugitive#Route(object, dir)
|
return fugitive#Find(object, dir)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:DotRelative(path) abort
|
function! s:DotRelative(path) abort
|
||||||
|
@ -43,8 +43,8 @@ function! FugitiveReal(...) abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! FugitiveRoute(...) abort
|
function! FugitiveFind(...) abort
|
||||||
return fugitive#Route(a:0 ? a:1 : bufnr(''), FugitiveGitDir(a:0 > 1 ? a:2 : -1))
|
return fugitive#Find(a:0 ? a:1 : bufnr(''), FugitiveGitDir(a:0 > 1 ? a:2 : -1))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! FugitivePath(...) abort
|
function! FugitivePath(...) abort
|
||||||
@ -205,12 +205,12 @@ function! FugitiveDetect(path) abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! FugitiveFind(...) abort
|
function! FugitiveRoute(...) abort
|
||||||
return call('FugitiveRoute', a:000)
|
return call('FugitiveFind', a:000)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! FugitiveGenerate(...) abort
|
function! FugitiveGenerate(...) abort
|
||||||
return call('FugitiveRoute', a:000)
|
throw 'Use FugitiveFind() instead'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:Slash(path) abort
|
function! s:Slash(path) abort
|
||||||
@ -260,7 +260,7 @@ augroup fugitive
|
|||||||
autocmd FileType gitrebase
|
autocmd FileType gitrebase
|
||||||
\ let &l:include = '^\%(pick\|squash\|edit\|reword\|fixup\|drop\|[pserfd]\)\>' |
|
\ let &l:include = '^\%(pick\|squash\|edit\|reword\|fixup\|drop\|[pserfd]\)\>' |
|
||||||
\ if exists('b:git_dir') |
|
\ if exists('b:git_dir') |
|
||||||
\ let &l:includeexpr = 'v:fname =~# ''^\x\{4,40\}$'' ? FugitiveRoute(v:fname) : ' .
|
\ let &l:includeexpr = 'v:fname =~# ''^\x\{4,40\}$'' ? FugitiveFind(v:fname) : ' .
|
||||||
\ (len(&l:includeexpr) ? &l:includeexpr : 'v:fname') |
|
\ (len(&l:includeexpr) ? &l:includeexpr : 'v:fname') |
|
||||||
\ endif |
|
\ endif |
|
||||||
\ let b:undo_ftplugin = get(b:, 'undo_ftplugin', 'exe') . '|setl inex= inc='
|
\ let b:undo_ftplugin = get(b:, 'undo_ftplugin', 'exe') . '|setl inex= inc='
|
||||||
|
Loading…
x
Reference in New Issue
Block a user