aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Threads/Pusher.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-30 11:52:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-30 11:52:44 -0400
commit40c997367544d72c6ab55eb96a1c3344fcf4012c (patch)
treed99d43e63d67687496d10859b5e8b8d9c6999f2c /Assistant/Threads/Pusher.hs
parent3dce75fb23fca94ad86c3f0ee816bb0ad2ecb27c (diff)
fix push status, broken when inParallel was adapted for -threaded
Before pushing ran in its own process, so exitSuccess was the right thing to do, but with the threaded code, that's caught as an exception.
Diffstat (limited to 'Assistant/Threads/Pusher.hs')
-rw-r--r--Assistant/Threads/Pusher.hs17
1 files changed, 5 insertions, 12 deletions
diff --git a/Assistant/Threads/Pusher.hs b/Assistant/Threads/Pusher.hs
index 0a0edf1d0..3fe85673b 100644
--- a/Assistant/Threads/Pusher.hs
+++ b/Assistant/Threads/Pusher.hs
@@ -92,33 +92,26 @@ pushToRemotes threadname now st mpushmap remotes = do
, show rs
]
Command.Sync.updateBranch (Command.Sync.syncBranch branch) g
- {- TODO git push exits nonzero if the remote
- - is already up-to-date. This code does not tell
- - the difference between the two. Could perhaps
- - be check the refs when it seemed to fail?
- - Note bewloe -}
(succeeded, failed) <- inParallel (push g branch) rs
+ let ok = null failed
case mpushmap of
Nothing -> noop
Just pushmap ->
changeFailedPushMap pushmap $ \m ->
M.union (makemap failed) $
M.difference m (makemap succeeded)
- unless (null failed) $
+ unless (ok) $
debug threadname
[ "failed to push to"
, show failed
]
- if (null failed || not shouldretry)
- {- TODO see above TODO item -}
- then return True -- return $ null failed
+ if (ok || not shouldretry)
+ then return ok
else retry branch g failed
makemap l = M.fromList $ zip l (repeat now)
- push g branch remote =
- ifM (Command.Sync.pushBranch remote branch g)
- ( exitSuccess, exitFailure)
+ push g branch remote = Command.Sync.pushBranch remote branch g
retry branch g rs = do
debug threadname [ "trying manual pull to resolve failed pushes" ]