mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Default g:ceiling_directories to parent of $HOME
References: https://github.com/tpope/vim-fugitive/issues/1457
This commit is contained in:
@@ -392,13 +392,13 @@ function! s:CeilingDirectories() abort
|
|||||||
if empty(dir)
|
if empty(dir)
|
||||||
let resolve = 0
|
let resolve = 0
|
||||||
elseif resolve
|
elseif resolve
|
||||||
call add(s:ceiling_directories, resolve(dir))
|
call add(s:ceiling_directories, s:Slash(resolve(dir)))
|
||||||
else
|
else
|
||||||
call add(s:ceiling_directories, dir)
|
call add(s:ceiling_directories, s:Slash(dir))
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
return s:ceiling_directories + get(g:, 'ceiling_directories', [])
|
return s:ceiling_directories + get(g:, 'ceiling_directories', [s:Slash(fnamemodify(expand('~'), ':h'))])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! FugitiveExtractGitDir(path) abort
|
function! FugitiveExtractGitDir(path) abort
|
||||||
@@ -428,8 +428,9 @@ function! FugitiveExtractGitDir(path) abort
|
|||||||
let previous = ""
|
let previous = ""
|
||||||
let env_git_dir = len($GIT_DIR) ? s:Slash(simplify(fnamemodify(FugitiveVimPath($GIT_DIR), ':p:s?[\/]$??'))) : ''
|
let env_git_dir = len($GIT_DIR) ? s:Slash(simplify(fnamemodify(FugitiveVimPath($GIT_DIR), ':p:s?[\/]$??'))) : ''
|
||||||
call s:Tree(env_git_dir)
|
call s:Tree(env_git_dir)
|
||||||
|
let ceiling_directories = s:CeilingDirectories()
|
||||||
while root !=# previous && root !~# '^$\|^//[^/]*$'
|
while root !=# previous && root !~# '^$\|^//[^/]*$'
|
||||||
if index(s:CeilingDirectories(), root) >= 0
|
if index(ceiling_directories, root) >= 0
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
if root ==# $GIT_WORK_TREE && FugitiveIsGitDir(env_git_dir)
|
if root ==# $GIT_WORK_TREE && FugitiveIsGitDir(env_git_dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user