refactor(git): adopt lazy-require plugin/git.lua pattern
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,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?
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user