mirror of
https://github.com/octoleo/lsyncd.git
synced 2025-01-22 14:48:29 +00:00
fixed moves from deleted dirs
This commit is contained in:
parent
d43c07c6ae
commit
38dc3c1d2f
23
lsyncd.lua
23
lsyncd.lua
@ -1590,17 +1590,28 @@ local Inotifies = (function()
|
||||
|
||||
-- looks up the watch descriptor id
|
||||
local path = wdpaths[wd]
|
||||
if path then
|
||||
path = path..filename
|
||||
end
|
||||
|
||||
local path2 = wd2 and wdpaths[wd2]
|
||||
if path2 and filename2 then
|
||||
path2 = path2..filename2
|
||||
end
|
||||
|
||||
if not path and path2 and etype =="Move" then
|
||||
log("Inotify", "Move from deleted directory ",path2,
|
||||
" becomes Create.")
|
||||
path = path2
|
||||
path2 = nil
|
||||
etype = "Create"
|
||||
end
|
||||
|
||||
if not path then
|
||||
-- this is normal in case of deleted subdirs
|
||||
log("Inotify", "event belongs to unknown watch descriptor.")
|
||||
return
|
||||
end
|
||||
path = path..filename
|
||||
|
||||
local path2 = wd2 and wdpaths[wd2]
|
||||
if path2 and filename2 then
|
||||
path2 = path2..filename2
|
||||
end
|
||||
|
||||
for sync, root in pairs(syncRoots) do repeat
|
||||
local relative = splitPath(path, root)
|
||||
|
Loading…
x
Reference in New Issue
Block a user