aboutsummaryrefslogtreecommitdiff
path: root/Command/Unused.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Unused.hs')
-rw-r--r--Command/Unused.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 6fb8f36c6..79285f7d1 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -228,10 +228,14 @@ withKeysReferencedM a = withKeysReferenced' () calla
calla k _ = a k
withKeysReferenced' :: v -> (Key -> v -> Annex v) -> Annex v
-withKeysReferenced' initial a = go initial =<< files
+withKeysReferenced' initial a = do
+ (files, clean) <- getfiles
+ r <- go initial files
+ liftIO $ void clean
+ return r
where
- files = ifM isBareRepo
- ( return []
+ getfiles = ifM isBareRepo
+ ( return ([], return True)
, do
top <- fromRepo Git.repoPath
inRepo $ LsFiles.inRepo [top]