From a80eafb5acb58d41a2feb0a9f77ffdb309b54424 Mon Sep 17 00:00:00 2001 From: JL102 Date: Thu, 28 Sep 2023 14:08:15 -0400 Subject: [PATCH] add force_autocrlf setting & some tests --- lua/lazy/core/config.lua | 5 +++++ lua/lazy/manage/task/git.lua | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lua/lazy/core/config.lua b/lua/lazy/core/config.lua index d0499fb..87131dd 100644 --- a/lua/lazy/core/config.lua +++ b/lua/lazy/core/config.lua @@ -28,6 +28,11 @@ M.defaults = { -- then set the below to false. This should work, but is NOT supported and will -- increase downloads a lot. filter = true, + -- If git config --global core.autocrlf is true on a Unix/Linux system, then the git clone + -- process will lead to files with CRLF endings. Vi / vim / neovim cannot handle this. + -- When true, Lazy will force git to clone with core.autocrlf=false. When false, Lazy will + -- not touch the core.autocrlf setting. + force_autocrlf = 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 bcecfec..342eccf 100644 --- a/lua/lazy/manage/task/git.lua +++ b/lua/lazy/manage/task/git.lua @@ -67,6 +67,8 @@ M.clone = { self.plugin.url, } + vim.print("force_autocrlf = " .. tostring(Config.options.git.force_autocrlf)) + if Config.options.git.filter then args[#args + 1] = "--filter=blob:none" end