From 751258da057d5dc83ea312d3547bf0f7a098af63 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 May 2013 13:58:41 -0400 Subject: minor optimisation and warning fix --- Annex/Direct.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Annex') diff --git a/Annex/Direct.hs b/Annex/Direct.hs index 1db046e7b..6d9f3e31d 100644 --- a/Annex/Direct.hs +++ b/Annex/Direct.hs @@ -206,9 +206,10 @@ toDirectGen k f = do {- Removes a direct mode file, while retaining its content in the annex. -} removeDirect :: Key -> FilePath -> Annex () removeDirect k f = do - locs <- removeAssociatedFile k f - unlessM (inAnnex k) $ - moveAnnex k f + otherlocs <- removeAssociatedFile k f + unless (null otherlocs) $ + unlessM (inAnnex k) $ + moveAnnex k f liftIO $ do nukeFile f void $ tryIO $ removeDirectory $ parentDir f -- cgit v1.2.3