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.

This commit is contained in:
Joey Hess 2013-05-21 18:24:29 -04:00
parent 700d5683a9
commit 08c03b2af3
11 changed files with 77 additions and 27 deletions

View file

@ -13,6 +13,7 @@ import Common
import Git
import Git.Sha
import Git.Command
import Git.Ref (headRef)
{- The currently checked out branch.
-
@ -35,7 +36,7 @@ current r = do
{- The current branch, which may not really exist yet. -}
currentUnsafe :: Repo -> IO (Maybe Git.Ref)
currentUnsafe r = parse . firstLine
<$> pipeReadStrict [Param "symbolic-ref", Param "HEAD"] r
<$> pipeReadStrict [Param "symbolic-ref", Param $ show headRef] r
where
parse l
| null l = Nothing