summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
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