fix bug where it did not check the cwd for the .git folder
This commit is contained in:
@@ -363,10 +363,12 @@ do
|
|||||||
local function look_for_file(glob_pattern)
|
local function look_for_file(glob_pattern)
|
||||||
---@type string[]
|
---@type string[]
|
||||||
local folders = {vim.fn.getcwd()}
|
local folders = {vim.fn.getcwd()}
|
||||||
for dir in vim.fs.parents(vim.fn.getcwd()) do
|
if not file_exists(folders[1], '.git') then
|
||||||
table.insert(folders, dir)
|
for dir in vim.fs.parents(vim.fn.getcwd()) do
|
||||||
if file_exists(dir, '.git') then
|
table.insert(folders, dir)
|
||||||
break
|
if file_exists(dir, '.git') then
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user