mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 23:03:51 -05:00
Fix when $GIT_DIR is set and is not an absolute path
This commit is contained in:
@@ -143,11 +143,11 @@ function! fugitive#extract_git_dir(path) abort
|
|||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
if root ==# $GIT_WORK_TREE && fugitive#is_git_dir($GIT_DIR)
|
if root ==# $GIT_WORK_TREE && fugitive#is_git_dir($GIT_DIR)
|
||||||
return $GIT_DIR
|
return simplify(fnamemodify(expand($GIT_DIR), ':p:s?[\/]$??'))
|
||||||
endif
|
endif
|
||||||
if fugitive#is_git_dir($GIT_DIR)
|
if fugitive#is_git_dir($GIT_DIR)
|
||||||
" Ensure that we've cached the worktree
|
" Ensure that we've cached the worktree
|
||||||
call s:configured_tree($GIT_DIR)
|
call s:configured_tree(simplify(fnamemodify(expand($GIT_DIR), ':p:s?[\/]$??')))
|
||||||
if has_key(s:dir_for_worktree, root)
|
if has_key(s:dir_for_worktree, root)
|
||||||
return s:dir_for_worktree[root]
|
return s:dir_for_worktree[root]
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user