summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-07-30 13:40:17 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-07-30 13:40:17 -0400
commit6b35e3ef6c62aca612d2edcc25397076f4a674b2 (patch)
treed3270c720a3ae057128ccb8d7473360f31b72330
parentad67cfe65ed387cbc64b2da7dd88603985999882 (diff)
avoid calling copy when file DNE
This avoids an ugly warning when running git annex fsck --from a rsync remote in a repo in direct mode.
-rw-r--r--Annex/Content.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index 397eb4061..1a2ed06c1 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -611,7 +611,10 @@ preseedTmp key file = go =<< inAnnex key
( return True
, do
s <- calcRepo $ gitAnnexLocation key
- liftIO $ copyFileExternal CopyTimeStamps s file
+ liftIO $ ifM (doesFileExist s)
+ ( copyFileExternal CopyTimeStamps s file
+ , return False
+ )
)
{- Blocks writing to an annexed file, and modifies file permissions to