diff options
-rw-r--r-- | Messages.hs | 12 | ||||
-rw-r--r-- | Remote/Git.hs | 3 |
2 files changed, 12 insertions, 3 deletions
diff --git a/Messages.hs b/Messages.hs index 4330f7c09..96bf3ae4b 100644 --- a/Messages.hs +++ b/Messages.hs @@ -14,6 +14,7 @@ module Messages ( MeterUpdate, showSideAction, doSideAction, + doQuietSideAction, showStoringStateAction, showOutput, showLongNote, @@ -91,12 +92,19 @@ showSideAction m = Annex.getState Annex.output >>= go showStoringStateAction :: Annex () showStoringStateAction = showSideAction "Recording state in git" +{- Performs an action, supressing showSideAction messages. -} +doQuietSideAction :: Annex a -> Annex a +doQuietSideAction = doSideAction' InBlock + {- Performs an action, that may call showSideAction multiple times. - Only the first will be displayed. -} doSideAction :: Annex a -> Annex a -doSideAction a = do +doSideAction = doSideAction' StartBlock + +doSideAction' :: SideActionBlock -> Annex a -> Annex a +doSideAction' b a = do o <- Annex.getState Annex.output - set $ o { sideActionBlock = StartBlock } + set $ o { sideActionBlock = b } set o `after` a where set o = Annex.changeState $ \s -> s { Annex.output = o } diff --git a/Remote/Git.hs b/Remote/Git.hs index 79439b784..cf7542d74 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -310,7 +310,8 @@ commitOnCleanup r a = go `after` a go = Annex.addCleanup (Git.repoLocation r) cleanup cleanup | not $ Git.repoIsUrl r = liftIO $ onLocal r $ - Annex.Branch.commit "update" + doQuietSideAction $ + Annex.Branch.commit "update" | otherwise = void $ do Just (shellcmd, shellparams) <- git_annex_shell r "commit" [] |