refactor(git): adopt lazy-require plugin/git.lua pattern

This commit is contained in:
2026-05-10 01:58:37 +02:00
parent 4364637385
commit 378c3622a8
10 changed files with 279 additions and 248 deletions
-2
View File
@@ -2,8 +2,6 @@ local cmd = require("git.cmd")
local h = require("test.git.helpers")
local t = require("test")
require("git").init()
---@param files table<string, string>?
---@return string dir
local function make_repo(files)
-2
View File
@@ -3,8 +3,6 @@ local h = require("test.git.helpers")
local object = require("git.object")
local t = require("test")
require("git").init()
---@return integer? buf
local function find_git_buf()
for _, b in ipairs(vim.api.nvim_list_bufs()) do
-2
View File
@@ -2,8 +2,6 @@
local h = require("test.git.helpers")
local t = require("test")
require("git").init()
---@param r ow.Git.Repo
---@param key string
---@param timeout integer?
-2
View File
@@ -1,8 +1,6 @@
local h = require("test.git.helpers")
local t = require("test")
require("git").init()
---Replicate the user's global cursor-restore autocmd. Scoped to a
---named augroup + cleanup so it doesn't leak between tests.
local function install_cursor_restore_autocmd()
+4
View File
@@ -15,6 +15,10 @@ for _, lua_dir in ipairs(vim.fn.glob(opt .. "/*/lua", false, true)) do
.. (";" .. lua_dir .. "/?/init.lua")
end
for _, f in ipairs(vim.fn.glob(cfg .. "/plugin/*.lua", false, true)) do
dofile(f)
end
local t = require("test")
---@param target string