diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-20 13:58:41 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-20 13:58:41 -0400 |
commit | 751258da057d5dc83ea312d3547bf0f7a098af63 (patch) | |
tree | dbd534d5596e4cbfc66de9e9d2d63c3afc5e7758 | |
parent | 38479eb02cba58fa624794a0da9295a2ddaaa4b6 (diff) |
minor optimisation and warning fix
-rw-r--r-- | Annex/Direct.hs | 7 |
1 files changed, 4 insertions, 3 deletions
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 |