aboutsummaryrefslogtreecommitdiff
path: root/Utility/Metered.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-11-16 19:32:30 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-11-16 19:32:30 -0400
commit5e7fe9663d2ced9c62d1d9b1a5c704dcde3c0492 (patch)
tree87d1e08f9ac50b17f470d8f2d8ea72c8dfb151ef /Utility/Metered.hs
parentaff42e84c3940a4968ed7e740bd1b1494ef63c45 (diff)
Display progress meter in -J mode when copying from a local git repo, to a local git repo, and from a remote git repo.
Had everything available, just didn't combine the progress meter with the other places progress is sent to update it. (And to a remote repo already did show progress.) Most special remotes should already display progress meters with -J, same as without it. One exception to this is the web, since it relies on wget/curl progress display without -J. Still todo..
Diffstat (limited to 'Utility/Metered.hs')
-rw-r--r--Utility/Metered.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Utility/Metered.hs b/Utility/Metered.hs
index c34e931a4..60dcf7c74 100644
--- a/Utility/Metered.hs
+++ b/Utility/Metered.hs
@@ -29,6 +29,9 @@ type MeterUpdate = (BytesProcessed -> IO ())
nullMeterUpdate :: MeterUpdate
nullMeterUpdate _ = return ()
+combineMeterUpdate :: MeterUpdate -> MeterUpdate -> MeterUpdate
+combineMeterUpdate a b = \n -> a n >> b n
+
{- Total number of bytes processed so far. -}
newtype BytesProcessed = BytesProcessed Integer
deriving (Eq, Ord, Show)