summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Committer.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-29 16:46:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-29 16:54:51 -0400
commit63a2756c8685418ec3743dca1cd7a5f0237f0762 (patch)
tree9f5206fcd943ebc1cd4d4f0da666c5e7a98ca9ae /Assistant/Threads/Committer.hs
parentf2214ee8978ee123a9833ab81d2e78a7d1867f71 (diff)
remove hard link when sanity check failed
Diffstat (limited to 'Assistant/Threads/Committer.hs')
-rw-r--r--Assistant/Threads/Committer.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs
index 445e44dea..ca2148236 100644
--- a/Assistant/Threads/Committer.hs
+++ b/Assistant/Threads/Committer.hs
@@ -213,7 +213,10 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do
ks <- liftIO $ getSymbolicLinkStatus $ contentLocation keysource
if deviceID ks == deviceID fs && fileID ks == fileID fs
then a
- else return Nothing
+ else do
+ -- remove the hard link
+ void $ liftIO $ tryIO $ removeFile $ contentLocation keysource
+ return Nothing
{- Files can Either be Right to be added now,
- or are unsafe, and must be Left for later.