From 6b35e3ef6c62aca612d2edcc25397076f4a674b2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Jul 2015 13:40:17 -0400 Subject: 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. --- Annex/Content.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Annex/Content.hs') 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 -- cgit v1.2.3