fix bug where it did not check the cwd for the .git folder

This commit is contained in:
2026-06-14 22:01:22 +02:00
parent 509994ac55
commit c7b7cf08e0
+6 -4
View File
@@ -363,10 +363,12 @@ do
local function look_for_file(glob_pattern)
---@type string[]
local folders = {vim.fn.getcwd()}
for dir in vim.fs.parents(vim.fn.getcwd()) do
table.insert(folders, dir)
if file_exists(dir, '.git') then
break
if not file_exists(folders[1], '.git') then
for dir in vim.fs.parents(vim.fn.getcwd()) do
table.insert(folders, dir)
if file_exists(dir, '.git') then
break
end
end
end