mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 21:33:53 -05:00
Restore .git_dir on fugitive#repo()
This will enable functions like FugitiveFind() to use fugitive#repo() as the optional second parameter, which should make transitioning to the new API a bit easier to do incrementally.
This commit is contained in:
@@ -1553,7 +1553,11 @@ endfunction
|
||||
let s:repo_prototype = {}
|
||||
|
||||
function! fugitive#repo(...) abort
|
||||
return copy(s:repo_prototype)
|
||||
let dir = a:0 ? s:GitDir(a:1) : (len(s:GitDir()) ? s:GitDir() : FugitiveExtractGitDir(expand('%:p')))
|
||||
if dir !=# ''
|
||||
return extend({'git_dir': dir, 'fugitive_dir': dir}, s:repo_prototype, 'keep')
|
||||
endif
|
||||
throw 'fugitive: not a Git repository'
|
||||
endfunction
|
||||
|
||||
function! s:repo_dir(...) dict abort
|
||||
|
||||
Reference in New Issue
Block a user