account for different git submodule format. resolves #273.
This commit is contained in:
parent
0f23d9373c
commit
2735282992
@ -40,7 +40,11 @@ function! s:check_in_path()
|
|||||||
if !exists('b:airline_branch_path')
|
if !exists('b:airline_branch_path')
|
||||||
let root = get(b:, 'git_dir', get(b:, 'mercurial_dir', ''))
|
let root = get(b:, 'git_dir', get(b:, 'mercurial_dir', ''))
|
||||||
let bufferpath = resolve(fnamemodify(expand('%'), ':p:h'))
|
let bufferpath = resolve(fnamemodify(expand('%'), ':p:h'))
|
||||||
|
|
||||||
|
" .git may be a repo or a file depending on the version of git for submodules
|
||||||
|
if !filereadable(root)
|
||||||
let root = expand(fnamemodify(root, ':h'))
|
let root = expand(fnamemodify(root, ':h'))
|
||||||
|
endif
|
||||||
let b:airline_file_in_root = stridx(bufferpath, root) > -1
|
let b:airline_file_in_root = stridx(bufferpath, root) > -1
|
||||||
endif
|
endif
|
||||||
return b:airline_file_in_root
|
return b:airline_file_in_root
|
||||||
|
Loading…
Reference in New Issue
Block a user