From 4c22c2261fbb8a0907a335675afd958a9b280a90 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 May 2013 13:58:41 -0400 Subject: [PATCH] minor optimisation and warning fix --- Annex/Direct.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Annex/Direct.hs b/Annex/Direct.hs index 1db046e7b6..6d9f3e31db 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