Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
syncmaildir: an empty file is like a non existing file
Browse files Browse the repository at this point in the history
  • Loading branch information
Enrico Tassi committed Nov 7, 2015
1 parent 6b0e17a commit 76b1a69
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion syncmaildir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,16 @@ function exists(name)
end
end

local empty_file_sha = "da39a3ee5e6b4b0d3255bfef95601890afd80709"

function exists_and_sha(name)
if exists(name) then
local h, b = sha_file(name)
return true, h, b
if h == empty_file_sha and b == empty_file_sha then
return false
else
return true, h, b
end
else
return false
end
Expand Down

0 comments on commit 76b1a69

Please sign in to comment.