summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-04 19:56:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-04 19:56:32 -0400
commitcd699ff50b8434b52e2f51d06414e8431b407482 (patch)
tree77291f6d6f6c340c41f9da5b3bbfeae4117d7764 /Command
parentbdbfe36e945e97d66c965bc7227d1457372bce32 (diff)
fix last zombies in the assistant
Made Git.LsFiles return cleanup actions, and everything waits on processes now, except of course for Seek.
Diffstat (limited to 'Command')
-rw-r--r--Command/Sync.hs4
-rw-r--r--Command/Unannex.hs4
-rw-r--r--Command/Unused.hs10
3 files changed, 13 insertions, 5 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index bbe6a98b3..11ea30a52 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -196,11 +196,13 @@ mergeFrom branch = do
resolveMerge :: Annex Bool
resolveMerge = do
top <- fromRepo Git.repoPath
- merged <- all id <$> (mapM resolveMerge' =<< inRepo (LsFiles.unmerged [top]))
+ (fs, cleanup) <- inRepo (LsFiles.unmerged [top])
+ merged <- all id <$> mapM resolveMerge' fs
when merged $ do
Annex.Queue.flush
void $ inRepo $ Git.Command.runBool "commit"
[Param "-m", Param "git-annex automatic merge conflict fix"]
+ void $ liftIO cleanup
return merged
resolveMerge' :: LsFiles.Unmerged -> Annex Bool
diff --git a/Command/Unannex.hs b/Command/Unannex.hs
index bf931adfd..67d81bec0 100644
--- a/Command/Unannex.hs
+++ b/Command/Unannex.hs
@@ -39,12 +39,14 @@ cleanup file key = do
-- Commit that removal now, to avoid later confusing the
-- pre-commit hook if this file is later added back to
-- git as a normal, non-annexed file.
- whenM (not . null <$> inRepo (LsFiles.staged [file])) $ do
+ (s, clean) <- inRepo $ LsFiles.staged [file]
+ when (not $ null s) $ do
showOutput
inRepo $ Git.Command.run "commit" [
Param "-q",
Params "-m", Param "content removed from git annex",
Param "--", File file]
+ void $ liftIO clean
ifM (Annex.getState Annex.fast)
( do
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]