From 0774f1bc255e91bf16c426908cd50ed038b21305 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 29 Nov 2022 12:36:07 +0100 Subject: [PATCH] feat: added support for Plugin.lock (wont update) --- README.md | 1 + lua/lazy/core/plugin.lua | 1 + lua/lazy/manage/task/git.lua | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/README.md b/README.md index b78df54..d3a650d 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ ## ✅ TODO +- [x] support for Plugin.lock - [ ] health checks: check merge conflicts async - [ ] defaults for git log - [x] view keybindings for update/clean/... diff --git a/lua/lazy/core/plugin.lua b/lua/lazy/core/plugin.lua index 2b9498d..09d8b6e 100644 --- a/lua/lazy/core/plugin.lua +++ b/lua/lazy/core/plugin.lua @@ -31,6 +31,7 @@ M.dirty = false ---@field tag? string ---@field commit? string ---@field version? string +---@field lock? boolean ---@class LazyPlugin: LazyPluginHandlers,LazyPluginHooks,LazyPluginRef ---@field [1] string diff --git a/lua/lazy/manage/task/git.lua b/lua/lazy/manage/task/git.lua index 137800b..a22675e 100644 --- a/lua/lazy/manage/task/git.lua +++ b/lua/lazy/manage/task/git.lua @@ -130,6 +130,10 @@ M.checkout = { local info = assert(Git.info(self.plugin.dir)) local target = assert(Git.get_target(self.plugin)) + if self.plugin.lock then + target = info + end + local lock if opts.lockfile then lock = Lock.get(self.plugin)