mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated plugins
This commit is contained in:
@ -376,7 +376,7 @@ function! fugitive#repo(...) abort
|
||||
endif
|
||||
return extend(repo, s:repo_prototype, 'keep')
|
||||
endif
|
||||
call s:throw('not a git repository: '.expand('%:p'))
|
||||
call s:throw('not a Git repository: ' . string(dir))
|
||||
endfunction
|
||||
|
||||
function! s:repo_dir(...) dict abort
|
||||
@ -400,19 +400,19 @@ function! s:repo_bare() dict abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:repo_route(object) dict abort
|
||||
return fugitive#Route(a:object, self.git_dir)
|
||||
function! s:repo_find(object) dict abort
|
||||
return fugitive#Find(a:object, self.git_dir)
|
||||
endfunction
|
||||
|
||||
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
|
||||
|
||||
function! s:repo_head(...) dict abort
|
||||
return fugitive#Head(a:0 ? a:1 : 0, self.git_dir)
|
||||
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
|
||||
return call('fugitive#Prepare', [self.git_dir] + a:000)
|
||||
@ -485,8 +485,24 @@ function! s:Owner(path, ...) abort
|
||||
return ''
|
||||
endif
|
||||
let [pdir, commit, file] = s:DirCommitFile(a:path)
|
||||
if s:cpath(dir, pdir) && commit =~# '^\x\{40\}$'
|
||||
return commit
|
||||
if s:cpath(dir, pdir)
|
||||
if commit =~# '^\x\{40\}$'
|
||||
return commit
|
||||
elseif commit ==# '2'
|
||||
return 'HEAD^{}'
|
||||
endif
|
||||
if filereadable(dir . '/MERGE_HEAD')
|
||||
let merge_head = 'MERGE_HEAD'
|
||||
elseif filereadable(dir . '/REBASE_HEAD')
|
||||
let merge_head = 'REBASE_HEAD'
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
if commit ==# '3'
|
||||
return merge_head . '^{}'
|
||||
elseif commit ==# '1'
|
||||
return s:TreeChomp('merge-base', 'HEAD', merge_head, '--')
|
||||
endif
|
||||
endif
|
||||
let path = fnamemodify(a:path, ':p')
|
||||
if s:cpath(dir . '/', path[0 : len(dir)]) && a:path =~# 'HEAD$'
|
||||
@ -565,7 +581,7 @@ function! s:Relative(...) abort
|
||||
return fugitive#Path(@%, a:0 ? a:1 : ':(top)')
|
||||
endfunction
|
||||
|
||||
function! fugitive#Route(object, ...) abort
|
||||
function! fugitive#Find(object, ...) abort
|
||||
if type(a:object) == type(0)
|
||||
let name = bufname(a:object)
|
||||
return s:PlatformSlash(name =~# '^$\|^/\|^\a\+:' ? name : getcwd() . '/' . name)
|
||||
@ -622,7 +638,7 @@ function! fugitive#Route(object, ...) abort
|
||||
else
|
||||
let altdir = FugitiveExtractGitDir(f)
|
||||
if len(altdir) && !s:cpath(dir, altdir)
|
||||
return fugitive#Route(a:object, altdir)
|
||||
return fugitive#Find(a:object, altdir)
|
||||
endif
|
||||
endif
|
||||
elseif rev =~# '^:[0-3]:'
|
||||
@ -654,7 +670,7 @@ function! fugitive#Route(object, ...) abort
|
||||
else
|
||||
let altdir = FugitiveExtractGitDir(file)
|
||||
if len(altdir) && !s:cpath(dir, altdir)
|
||||
return fugitive#Route(a:object, altdir)
|
||||
return fugitive#Find(a:object, altdir)
|
||||
endif
|
||||
return file
|
||||
endif
|
||||
@ -682,7 +698,7 @@ function! s:Generate(rev, ...) abort
|
||||
elseif a:rev =~# '^/' && len(tree) && getftime(tree . a:rev) >= 0 && getftime(a:rev) < 0
|
||||
let object = ':(top)' . a:rev[1:-1]
|
||||
endif
|
||||
return fugitive#Route(object, dir)
|
||||
return fugitive#Find(object, dir)
|
||||
endfunction
|
||||
|
||||
function! s:DotRelative(path) abort
|
||||
@ -1082,7 +1098,7 @@ function! fugitive#buffer(...) abort
|
||||
if buffer.getvar('git_dir') !=# ''
|
||||
return buffer
|
||||
endif
|
||||
call s:throw('not a git repository: '.bufname(buffer['#']))
|
||||
call s:throw('not a Fugitive buffer: ' . string(bufname(buffer['#'])))
|
||||
endfunction
|
||||
|
||||
function! s:buffer_getvar(var) dict abort
|
||||
@ -1500,7 +1516,7 @@ function! fugitive#BufReadCmd(...) abort
|
||||
if lnum
|
||||
silent keepjumps delete_
|
||||
end
|
||||
silent exe (exists(':keeppatterns') ? 'keeppatterns' : '') 'keepjumps 1,/^diff --git\|\%$/g/\r$/s///'
|
||||
silent exe (exists(':keeppatterns') ? 'keeppatterns' : '') 'keepjumps 1,/^diff --git\|\%$/s/\r$//e'
|
||||
keepjumps 1
|
||||
endif
|
||||
elseif b:fugitive_type ==# 'stage'
|
||||
|
Reference in New Issue
Block a user