From 63a2756c8685418ec3743dca1cd7a5f0237f0762 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 29 Nov 2012 16:46:59 -0400 Subject: remove hard link when sanity check failed See http://git-annex.branchable.com/forum/dot_git_slash_annex_slash_tmp/ --- Assistant/Threads/Committer.hs | 5 ++++- debian/changelog | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) 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. diff --git a/debian/changelog b/debian/changelog index 440c19514..66c29a634 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,9 @@ git-annex (3.20121128) UNRELEASED; urgency=low * Fix broken .config/git-annex/program installed by standalone tarball. * assistant: Retrival from glacier now handled. * Include ssh in standalone tarball and OSX app. + * watch: Avoid leaving hard links to files behind in .git/annex/tmp + if a file is deleted or moved while it's being quarantined in preparation + to being added to the annex. -- Joey Hess Wed, 28 Nov 2012 13:31:07 -0400 -- cgit v1.2.3