mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 06:43:51 -05:00
Use cwd to find Git repository for terminal window
Closes https://github.com/tpope/vim-fugitive/issues/1520
This commit is contained in:
@@ -18,7 +18,7 @@ function! FugitiveGitDir(...) abort
|
||||
return g:fugitive_event
|
||||
endif
|
||||
let dir = get(b:, 'git_dir', '')
|
||||
if empty(dir) && (empty(bufname('')) || &buftype =~# '^\%(nofile\|acwrite\|quickfix\|prompt\)$')
|
||||
if empty(dir) && (empty(bufname('')) || &buftype =~# '^\%(nofile\|acwrite\|quickfix\|terminal\|prompt\)$')
|
||||
return FugitiveExtractGitDir(getcwd())
|
||||
elseif (!exists('b:git_dir') || b:git_dir =~# s:bad_git_dir) && empty(&buftype)
|
||||
let b:git_dir = FugitiveExtractGitDir(expand('%:p'))
|
||||
|
||||
Reference in New Issue
Block a user