fix(git): automatically restore doc/tags when modified

This commit is contained in:
Folke Lemaitre 2023-10-10 11:41:49 +02:00
parent 43e9165994
commit 736529d097
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 6 additions and 0 deletions

View File

@ -168,6 +168,12 @@ M.status = {
if ok then
local lines = vim.split(output, "\n")
lines = vim.tbl_filter(function(line)
-- Fix doc/tags being marked as modified
if line:gsub("[\\/]", "/") == "doc/tags" then
local Process = require("lazy.manage.process")
Process.exec({ "git", "checkout", "--", "doc/tags" }, { cwd = self.plugin.dir })
return false
end
return line ~= ""
end, lines)
if #lines > 0 then