Fix bug introduced in version 6.20171018 that caused some commands to print out "ok" twice after processing a file.
This commit was sponsored by Boyd Stephen Smith Jr. on Patreon
This commit is contained in:
parent
67338fd7ac
commit
beb67fbbad
2 changed files with 11 additions and 4 deletions
|
@ -3,6 +3,8 @@ git-annex (6.20171215) UNRELEASED; urgency=medium
|
||||||
* Removed the testsuite build flag; test suite is always included.
|
* Removed the testsuite build flag; test suite is always included.
|
||||||
* Added inprogress command for accessing files as they are being
|
* Added inprogress command for accessing files as they are being
|
||||||
downloaded.
|
downloaded.
|
||||||
|
* Fix bug introduced in version 6.20171018 that caused some commands
|
||||||
|
to print out "ok" twice after processing a file.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Wed, 20 Dec 2017 12:11:46 -0400
|
-- Joey Hess <id@joeyh.name> Wed, 20 Dec 2017 12:11:46 -0400
|
||||||
|
|
||||||
|
|
|
@ -149,15 +149,20 @@ callCommandAction = fromMaybe True <$$> callCommandAction'
|
||||||
{- Like callCommandAction, but returns Nothing when the command did not
|
{- Like callCommandAction, but returns Nothing when the command did not
|
||||||
- perform any action. -}
|
- perform any action. -}
|
||||||
callCommandAction' :: CommandStart -> Annex (Maybe Bool)
|
callCommandAction' :: CommandStart -> Annex (Maybe Bool)
|
||||||
callCommandAction' = start
|
callCommandAction' a = callCommandActionQuiet a >>= \case
|
||||||
|
Nothing -> return Nothing
|
||||||
|
Just r -> implicitMessage (showEndResult r) >> return (Just r)
|
||||||
|
|
||||||
|
callCommandActionQuiet :: CommandStart -> Annex (Maybe Bool)
|
||||||
|
callCommandActionQuiet = start
|
||||||
where
|
where
|
||||||
start = stage $ maybe skip perform
|
start = stage $ maybe skip perform
|
||||||
perform = stage $ maybe failure cleanup
|
perform = stage $ maybe failure cleanup
|
||||||
cleanup = stage $ status
|
cleanup = stage $ status
|
||||||
stage = (=<<)
|
stage = (=<<)
|
||||||
skip = return Nothing
|
skip = return Nothing
|
||||||
failure = implicitMessage showEndFail >> return (Just False)
|
failure = return (Just False)
|
||||||
status r = implicitMessage (showEndResult r) >> return (Just r)
|
status = return . Just
|
||||||
|
|
||||||
{- Do concurrent output when that has been requested. -}
|
{- Do concurrent output when that has been requested. -}
|
||||||
allowConcurrentOutput :: Annex a -> Annex a
|
allowConcurrentOutput :: Annex a -> Annex a
|
||||||
|
@ -188,7 +193,7 @@ onlyActionOn k a = onlyActionOn' k run
|
||||||
where
|
where
|
||||||
-- Run whole action, not just start stage, so other threads
|
-- Run whole action, not just start stage, so other threads
|
||||||
-- block until it's done.
|
-- block until it's done.
|
||||||
run = callCommandAction' a >>= \case
|
run = callCommandActionQuiet a >>= \case
|
||||||
Nothing -> return Nothing
|
Nothing -> return Nothing
|
||||||
Just r' -> return $ Just $ return $ Just $ return r'
|
Just r' -> return $ Just $ return $ Just $ return r'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue