mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 21:33:53 -05:00
Always set b:git_dir
This makes it possible to tell when detection hasn't happened yet, and is potentially a stepping stone to doing it on the fly.
This commit is contained in:
@@ -2371,8 +2371,8 @@ function! s:TempReadPre(file) abort
|
|||||||
endif
|
endif
|
||||||
setlocal buftype=nowrite
|
setlocal buftype=nowrite
|
||||||
setlocal nomodifiable
|
setlocal nomodifiable
|
||||||
|
let b:git_dir = dict.dir
|
||||||
if len(dict.dir)
|
if len(dict.dir)
|
||||||
let b:git_dir = dict.dir
|
|
||||||
call extend(b:, {'fugitive_type': 'temp'}, 'keep')
|
call extend(b:, {'fugitive_type': 'temp'}, 'keep')
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ function! FugitiveHead(...) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! FugitiveStatusline(...) abort
|
function! FugitiveStatusline(...) abort
|
||||||
if !exists('b:git_dir')
|
if empty(get(b:, 'git_dir', ''))
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
return fugitive#Statusline()
|
return fugitive#Statusline()
|
||||||
@@ -277,12 +277,9 @@ function! FugitiveDetect(path) abort
|
|||||||
unlet b:git_dir
|
unlet b:git_dir
|
||||||
endif
|
endif
|
||||||
if !exists('b:git_dir')
|
if !exists('b:git_dir')
|
||||||
let dir = FugitiveExtractGitDir(a:path)
|
let b:git_dir = FugitiveExtractGitDir(a:path)
|
||||||
if dir !=# ''
|
|
||||||
let b:git_dir = dir
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
if !exists('b:git_dir') || !exists('#User#Fugitive')
|
if empty(b:git_dir) || !exists('#User#Fugitive')
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
if v:version >= 704 || (v:version == 703 && has('patch442'))
|
if v:version >= 704 || (v:version == 703 && has('patch442'))
|
||||||
|
|||||||
Reference in New Issue
Block a user