From 26a67e3c48951ca3ce47d208c3216143749b0768 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 23 Jan 2023 19:18:15 +0100 Subject: [PATCH] feat(config): added option to disable git filter. NOT recommended. Fixes #442 --- lua/lazy/core/config.lua | 4 ++++ lua/lazy/manage/task/git.lua | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index ec30ee0..dd1bdae 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -21,6 +21,10 @@ M.defaults = { log = { "--since=3 days ago" }, -- show commits from the last 3 days timeout = 120, -- kill processes that take more than 2 minutes url_format = "https://github.com/%s.git", + -- lazy.nvim requires git >=2.19.0. If you really want to use lazy with an older version, + -- then set the below to false. This is should work, but is NOT supported and will + -- increase downloads a lot. + filter = true, }, dev = { -- directory where you store your local plugin projects diff --git a/lua/lazy/manage/task/git.lua b/lua/lazy/manage/task/git.lua index c314c90..f07fce0 100644 --- a/lua/lazy/manage/task/git.lua +++ b/lua/lazy/manage/task/git.lua @@ -64,10 +64,16 @@ M.clone = { local args = { "clone", self.plugin.url, - "--filter=blob:none", + } + + if Config.options.git.filter then + args[#args + 1] = "--filter=blob:none" + end + + vim.list_extend(args, { "--recurse-submodules", "--progress", - } + }) if self.plugin.branch then vim.list_extend(args, { "-b", self.plugin.branch })