diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-21 18:24:29 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-21 18:24:29 -0400 |
commit | b6ebb173e7b5d4d07577cb2918e7d1a24fbc1f60 (patch) | |
tree | 8c994e00b091c448d80737aa99bbc181701eee04 /Assistant/Sync.hs | |
parent | 14f2a42ca4131a7a51a9e10a94521639b971bccd (diff) |
XMPP: Avoid redundant and unncessary pushes. Note that this breaks compatibility with previous versions of git-annex, which will refuse to accept any XMPP pushes from this version.
Diffstat (limited to 'Assistant/Sync.hs')
-rw-r--r-- | Assistant/Sync.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Assistant/Sync.hs b/Assistant/Sync.hs index 1b9de1656..cff4f95e0 100644 --- a/Assistant/Sync.hs +++ b/Assistant/Sync.hs @@ -20,6 +20,7 @@ import Utility.Parallel import qualified Git import qualified Git.Branch import qualified Git.Command +import qualified Git.Ref import qualified Remote import qualified Types.Remote as Remote import qualified Annex.Branch @@ -112,8 +113,11 @@ pushToRemotes' now notifypushes remotes = do <*> getUUID let (xmppremotes, normalremotes) = partition isXMPPRemote remotes ret <- go True branch g u normalremotes - forM_ xmppremotes $ \r -> - sendNetMessage $ Pushing (getXMPPClientID r) (CanPush u) + unless (null xmppremotes) $ do + shas <- liftAnnex $ map fst <$> + inRepo (Git.Ref.matching [Annex.Branch.fullname, Git.Ref.headRef]) + forM_ xmppremotes $ \r -> sendNetMessage $ + Pushing (getXMPPClientID r) (CanPush u shas) return ret where go _ Nothing _ _ _ = return [] -- no branch, so nothing to do |