From d0d410bc222a475202d9c2b55d1c5fbd12c26ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kr=C3=B3l?= Date: Sat, 20 Jan 2024 15:05:26 +0100 Subject: [PATCH] fix(git): comment sign detection in get_config function (#1281) - Modify the condition in the get_config function to correctly ignore comments and blank lines. - Update the regular expression to exclude lines starting with '#' or ';'. - This change ensures that only valid key-value pairs are added to the configuration table. --- lua/lazy/manage/git.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazy/manage/git.lua b/lua/lazy/manage/git.lua index 98c44b5..6b0ab58 100644 --- a/lua/lazy/manage/git.lua +++ b/lua/lazy/manage/git.lua @@ -217,7 +217,7 @@ function M.get_config(repo) current_section = section:gsub('%s+"', "."):gsub('"+%s*$', "") else -- Ignore comments and blank lines - if not line:match("^%s*#") and line:match("%S") then + if not line:match("^%s*[#;]") and line:match("%S") then local key, value = line:match("^%s*(%S+)%s*=%s*(.+)%s*$") ret[current_section .. "." .. key] = value end