summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Annex/GitOverlay.hs19
-rw-r--r--Annex/Queue.hs1
-rw-r--r--Test.hs4
-rw-r--r--doc/assistant/comment_7_831a529c92951f70a27721210204e46b._comment7
4 files changed, 25 insertions, 6 deletions
diff --git a/Annex/GitOverlay.hs b/Annex/GitOverlay.hs
index 2193b7449..1b7ceb2e2 100644
--- a/Annex/GitOverlay.hs
+++ b/Annex/GitOverlay.hs
@@ -15,6 +15,7 @@ import Git.Types
import Git.Index
import Git.Env
import qualified Annex
+import qualified Annex.Queue
{- Runs an action using a different git index file. -}
withIndexFile :: FilePath -> Annex a -> Annex a
@@ -71,8 +72,18 @@ withAltRepo
withAltRepo modrepo unmodrepo a = do
g <- gitRepo
g' <- liftIO $ modrepo g
- r <- tryNonAsync $ do
- Annex.changeState $ \s -> s { Annex.repo = g' }
+ q <- Annex.Queue.get
+ v <- tryNonAsync $ do
+ Annex.changeState $ \s -> s
+ { Annex.repo = g'
+ -- Start a separate queue for any changes made
+ -- with the modified repo.
+ , Annex.repoqueue = Nothing
+ }
a
- Annex.changeState $ \s -> s { Annex.repo = unmodrepo g (Annex.repo s) }
- either E.throw return r
+ void $ tryNonAsync Annex.Queue.flush
+ Annex.changeState $ \s -> s
+ { Annex.repo = unmodrepo g (Annex.repo s)
+ , Annex.repoqueue = Just q
+ }
+ either E.throw return v
diff --git a/Annex/Queue.hs b/Annex/Queue.hs
index 0e1b0f68c..9c22e75fd 100644
--- a/Annex/Queue.hs
+++ b/Annex/Queue.hs
@@ -13,6 +13,7 @@ module Annex.Queue (
flush,
flushWhenFull,
size,
+ get,
mergeFrom,
) where
diff --git a/Test.hs b/Test.hs
index 27cca4e66..0a9b6267a 100644
--- a/Test.hs
+++ b/Test.hs
@@ -969,9 +969,9 @@ test_union_merge_regression =
git_annex "get" [annexedfile] @? "get failed"
boolSystem "git" [Param "remote", Param "rm", Param "origin"] @? "remote rm"
forM_ [r3, r2, r1] $ \r -> indir r $
- git_annex "sync" [] @? "sync failed"
+ git_annex "sync" [] @? ("sync failed in " ++ r)
forM_ [r3, r2] $ \r -> indir r $
- git_annex "drop" ["--force", annexedfile] @? "drop failed"
+ git_annex "drop" ["--force", annexedfile] @? ("drop failed in " ++ r)
indir r1 $ do
git_annex "sync" [] @? "sync failed in r1"
git_annex_expectoutput "find" ["--in", "r3"] []
diff --git a/doc/assistant/comment_7_831a529c92951f70a27721210204e46b._comment b/doc/assistant/comment_7_831a529c92951f70a27721210204e46b._comment
new file mode 100644
index 000000000..deaf693bb
--- /dev/null
+++ b/doc/assistant/comment_7_831a529c92951f70a27721210204e46b._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="https://woid.cryptobitch.de/foobar"
+ subject="@niklaas"
+ date="2015-08-17T13:42:26Z"
+ content="""
+Joey Hess is using xmonad.
+"""]]