fix(#2695): git toplevel guard against missing paths (#2696)

This commit is contained in:
Alexander Courtis 2024-03-14 16:23:58 +11:00 committed by GitHub
parent 041dbd18f4
commit 3c4267eb50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -136,6 +136,10 @@ end
---@param path string absolute ---@param path string absolute
---@return string|nil ---@return string|nil
function M.get_toplevel(path) function M.get_toplevel(path)
if not path then
return nil
end
if not M.config.git.enable then if not M.config.git.enable then
return nil return nil
end end