fixup: error on branch component when stray .git files exist
fixes #490
This commit is contained in:
parent
afaa540333
commit
9e26823ea6
|
@ -347,7 +347,7 @@ in component.
|
|||
theme = 'auto', -- lualine theme
|
||||
component_separators = {left = '', right = ''},
|
||||
section_separators = {left = '', right = ''},
|
||||
disabled_filetypes = {}, -- filetypes to diable lualine on
|
||||
disabled_filetypes = {}, -- filetypes to disable lualine on
|
||||
always_divide_middle = true, -- When true left_sections (a,b,c) can't
|
||||
-- take over entiee statusline even
|
||||
-- when none of section x, y, z is present.
|
||||
|
|
|
@ -78,9 +78,11 @@ function M.find_git_dir(dir_path)
|
|||
elseif git_file_stat.type == 'file' then
|
||||
-- separate git-dir or submodule is used
|
||||
local file = io.open(git_path)
|
||||
if file then
|
||||
git_dir = file:read()
|
||||
git_dir = git_dir:match 'gitdir: (.+)$'
|
||||
git_dir = git_dir and git_dir:match 'gitdir: (.+)$'
|
||||
file:close()
|
||||
end
|
||||
-- submodule / relative file path
|
||||
if git_dir and git_dir:sub(1, 1) ~= sep and not git_dir:match '^%a:.*$' then
|
||||
git_dir = git_path:match '(.*).git' .. git_dir
|
||||
|
|
Loading…
Reference in New Issue