fix nested progress meters when using git-annex-shell fallback
Caused an ugly blank line when the first progress meter was not used, but also it may have confused -J display.
This commit is contained in:
parent
7bed3927ba
commit
b96b845ffd
3 changed files with 21 additions and 23 deletions
|
@ -30,17 +30,17 @@ type ProtoConnRunner c = forall a. P2P.Proto a -> ClosableConnection c -> Annex
|
|||
-- the pool when done.
|
||||
type WithConn a c = (ClosableConnection c -> Annex (ClosableConnection c, a)) -> Annex a
|
||||
|
||||
store :: ProtoRunner Bool -> Key -> AssociatedFile -> MeterUpdate -> Annex Bool
|
||||
store :: (MeterUpdate -> ProtoRunner Bool) -> Key -> AssociatedFile -> MeterUpdate -> Annex Bool
|
||||
store runner k af p = do
|
||||
let getsrcfile = fmap fst <$> prepSendAnnex k
|
||||
metered (Just p) k getsrcfile $ \p' ->
|
||||
fromMaybe False
|
||||
<$> runner (P2P.put k af p')
|
||||
<$> runner p' (P2P.put k af p')
|
||||
|
||||
retrieve :: ProtoRunner Bool -> Key -> AssociatedFile -> FilePath -> MeterUpdate -> Annex (Bool, Verification)
|
||||
retrieve :: (MeterUpdate -> ProtoRunner Bool) -> Key -> AssociatedFile -> FilePath -> MeterUpdate -> Annex (Bool, Verification)
|
||||
retrieve runner k af dest p = unVerified $
|
||||
metered (Just p) k (return Nothing) $ \p' -> fromMaybe False
|
||||
<$> runner (P2P.get dest k af p')
|
||||
<$> runner p (P2P.get dest k af p')
|
||||
|
||||
remove :: ProtoRunner Bool -> Key -> Annex Bool
|
||||
remove runner k = fromMaybe False <$> runner (P2P.remove k)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue