diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index d493938..9865db9 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -143,11 +143,11 @@ function! fugitive#extract_git_dir(path) abort break endif if root ==# $GIT_WORK_TREE && fugitive#is_git_dir($GIT_DIR) - return $GIT_DIR + return simplify(fnamemodify(expand($GIT_DIR), ':p:s?[\/]$??')) endif if fugitive#is_git_dir($GIT_DIR) " 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) return s:dir_for_worktree[root] endif