summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2022-02-06 12:31:09 +0100
committerDaniel Weipert <code@drogueronin.de>2022-02-06 12:31:09 +0100
commit8c129f92b86e1686bc0cd59bd141bb2c4d0bf466 (patch)
treed61de0c9c8d74c8c938bbf489864937383f58d93 /lua
parenta4bcaf47c0996092ef3b667ef3993e07959e3700 (diff)
Fix global gitignore include
Diffstat (limited to 'lua')
-rw-r--r--lua/rclone.lua5
1 files 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