remove dead code

flags no longer used anywhere
This commit is contained in:
Joey Hess 2022-06-28 15:41:25 -04:00
parent 543993b068
commit 6984bcdba9
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -19,10 +19,8 @@ module Annex (
getState,
changeState,
withState,
setFlag,
setField,
setOutput,
getFlag,
getField,
addCleanupAction,
gitRepo,
@ -189,7 +187,6 @@ data AnnexState = AnnexState
, trustmap :: Maybe TrustMap
, groupmap :: Maybe GroupMap
, lockcache :: LockCache
, flags :: M.Map String Bool
, fields :: M.Map String String
, cleanupactions :: M.Map CleanupAction (Annex ())
, sentinalstatus :: Maybe SentinalStatus
@ -245,7 +242,6 @@ newAnnexState c r = do
, trustmap = Nothing
, groupmap = Nothing
, lockcache = M.empty
, flags = M.empty
, fields = M.empty
, cleanupactions = M.empty
, sentinalstatus = Nothing
@ -327,11 +323,6 @@ withState modifier = do
mvar <- fst <$> ask
liftIO $ modifyMVar mvar modifier
{- Sets a flag to True -}
setFlag :: String -> Annex ()
setFlag flag = changeState $ \st ->
st { flags = M.insert flag True $ flags st }
{- Sets a field to a value -}
setField :: String -> String -> Annex ()
setField field value = changeState $ \st ->
@ -348,10 +339,6 @@ setOutput o = changeState $ \st ->
let m = output st
in st { output = m { outputType = adjustOutputType (outputType m) o } }
{- Checks if a flag was set. -}
getFlag :: String -> Annex Bool
getFlag flag = fromMaybe False . M.lookup flag <$> getState flags
{- Gets the value of a field. -}
getField :: String -> Annex (Maybe String)
getField field = M.lookup field <$> getState fields