diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-06-07 13:41:04 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-06-07 13:45:18 -0400 |
commit | 656efe58861dc621c462eaee6fe795395c0d343c (patch) | |
tree | 18b802adf3048e11567ec785893929600c394e76 /Assistant | |
parent | de780348c8f92be1a9a6f18a708ba3e730ac7149 (diff) |
analysis
Also, added a comment to Assistant/Threads/Merger.hs to explain
why it only merges from /synced/ branches.
Diffstat (limited to 'Assistant')
-rw-r--r-- | Assistant/Threads/Merger.hs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Assistant/Threads/Merger.hs b/Assistant/Threads/Merger.hs index 05341db1e..ff98cce5f 100644 --- a/Assistant/Threads/Merger.hs +++ b/Assistant/Threads/Merger.hs @@ -63,13 +63,18 @@ onChange file diverged <- liftAnnex Annex.Branch.forceUpdate when diverged $ queueDeferredDownloads "retrying deferred download" Later - | "/synced/" `isInfixOf` file = - mergecurrent =<< liftAnnex (join Command.Sync.getCurrBranch) + -- Merge only from /synced/ branches, which are pushed by git-annex + -- sync and by remote instances of the assistant. + -- It would be nice to merge other remote tracking branches, + -- but it's hard to get an efficient list of them (git remote -r) + | "/synced/" `isInfixOf` file = mergecurrent | otherwise = noop where changedbranch = fileToBranch file - mergecurrent currbranch@(Just b, _) + mergecurrent = + mergecurrent' =<< liftAnnex (join Command.Sync.getCurrBranch) + mergecurrent' currbranch@(Just b, _) | equivBranches changedbranch b = whenM (liftAnnex $ inRepo $ Git.Branch.changed b changedbranch) $ do debug @@ -81,7 +86,7 @@ onChange file def Git.Branch.AutomaticCommit changedbranch - mergecurrent _ = noop + mergecurrent' _ = noop equivBranches :: Git.Ref -> Git.Ref -> Bool equivBranches x y = base x == base y |