From 8c129f92b86e1686bc0cd59bd141bb2c4d0bf466 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 6 Feb 2022 12:31:09 +0100 Subject: Fix global gitignore include --- lua/rclone.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/rclone.lua b/lua/rclone.lua index 2749953..51346e7 100644 --- a/lua/rclone.lua +++ b/lua/rclone.lua @@ -182,9 +182,10 @@ local function build_cmd_exclude(local_path) end local handle = io.popen('git config --get core.excludesfile', 'r') - local gitignore_global = Path:new((Path:new(handle:read())):expand()) + local output = handle:read() handle:close() - if gitignore_global:exists() then + local gitignore_global = Path:new((Path:new(output)):expand()) + if output ~= nil and gitignore_global:exists() then cmd = cmd .. ' --exclude-from=' .. gitignore_global.filename end -- cgit v1.2.3