From bebc9657356d49a22ab9de723d4c3b40f68fa09e Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sat, 22 Jan 2022 14:30:05 +0100 Subject: Add global gitignore to exclude files --- lua/rclone.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lua/rclone.lua') diff --git a/lua/rclone.lua b/lua/rclone.lua index fe0b85a..ae37188 100644 --- a/lua/rclone.lua +++ b/lua/rclone.lua @@ -181,6 +181,13 @@ local function build_cmd_exclude(local_path) cmd = cmd .. ' --exclude-from=' .. gitignore.filename end + local handle = io.popen('git config --get core.excludesfile', 'r') + local gitignore_global = Path:new((Path:new(handle:read())):expand()) + handle:close() + if gitignore_global:exists() then + cmd = cmd .. ' --exclude-from=' .. gitignore_global.filename + end + -- add .rcloneignore patterns local rcloneignore = Path:new(local_path .. '/.rcloneignore') if rcloneignore:exists() then -- cgit v1.2.3