diff options
author | Joey Hess <joey@kitenet.net> | 2014-06-16 11:32:13 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-06-16 11:32:13 -0400 |
commit | 5b1ea5fe5af25cd88c45a87d3bbe36ea7eed7145 (patch) | |
tree | ecbba4af5cd2f7383bcd07f373c9fa99ca847cd8 /Assistant/Threads | |
parent | f9413b779ee821092af306f30fa9b6e668617432 (diff) |
assistant: Fix one-way assistant->assistant sync in direct mode.
When in direct mode, update the master branch after committing to the
annex/direct/master branch. Also, update the synced/master branch.
This fixes a topology A->B where both A and B are in direct mode and
running the assistant, and a change is made to B. Before this fix, A pulled
the changes from B, but since they were only on the annex/direct/master
branch, it did not merge them.
Note that I considered making the assistant merge the
remotes/B/annex/direct/master, but decided to keep it simple and only merge
the sync branches as before.
Diffstat (limited to 'Assistant/Threads')
-rw-r--r-- | Assistant/Threads/Committer.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs index 275586343..2b60e42f3 100644 --- a/Assistant/Threads/Committer.hs +++ b/Assistant/Threads/Committer.hs @@ -35,6 +35,7 @@ import qualified Annex import Utility.InodeCache import Annex.Content.Direct import qualified Command.Sync +import qualified Git.Branch import Data.Time.Clock import Data.Tuple.Utils @@ -219,7 +220,11 @@ commitStaged = do v <- tryAnnex Annex.Queue.flush case v of Left _ -> return False - Right _ -> Command.Sync.commitStaged "" + Right _ -> do + ok <- Command.Sync.commitStaged "" + when ok $ + Command.Sync.updateSyncBranch =<< inRepo Git.Branch.current + return ok {- OSX needs a short delay after a file is added before locking it down, - when using a non-direct mode repository, as pasting a file seems to |