summaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-24 15:38:24 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-24 15:38:24 -0400
commitac4be3de323345ab4a6cb4a624b975ac686cc2d5 (patch)
tree36ae0bb1fa5362a415a44b732ecd58b490fa0442 /Assistant
parent2a4dae593af85e0811529e718ea73151eddabcf1 (diff)
queue uploads when a new or renamed symlink is handled
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/Threads/Watcher.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Assistant/Threads/Watcher.hs b/Assistant/Threads/Watcher.hs
index a74976deb..e56e47aea 100644
--- a/Assistant/Threads/Watcher.hs
+++ b/Assistant/Threads/Watcher.hs
@@ -178,12 +178,15 @@ onAddSymlink file filestatus = go =<< liftAnnex (Backend.lookupFile file)
madeChange file LinkChange
{- When a new link appears, or a link is changed, after the startup
- - scan, handle getting or dropping the key's content. -}
+ - scan, handle getting or dropping the key's content.
+ - Also, moving or copying a link may caused it be be transferred
+ - elsewhere, so check that too. -}
checkcontent key daemonstatus
| scanComplete daemonstatus = do
present <- liftAnnex $ inAnnex key
- unless present $
- queueTransfers Next key (Just file) Download
+ if present
+ then queueTransfers Next key (Just file) Upload
+ else queueTransfers Next key (Just file) Download
handleDrops present key (Just file)
| otherwise = noop