final readonly values moves to AnnexRead

At this point I've checked all AnnexState values and these were all that
remained that could move.

Pity that Annex.repo can't move, but it gets modified sometimes..

A couple of AnnexState values are set by options and could be AnnexRead,
but happen to use Annex when being set.

Sponsored-by: Max Thoursie on Patreon
This commit is contained in:
Joey Hess 2022-06-28 16:02:01 -04:00
parent 6984bcdba9
commit 8040ecf9b8
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 12 additions and 11 deletions

View file

@ -126,6 +126,8 @@ data AnnexRead = AnnexRead
, forcenumcopies :: Maybe NumCopies
, forcemincopies :: Maybe MinCopies
, forcebackend :: Maybe String
, useragent :: Maybe String
, desktopnotify :: DesktopNotify
}
newAnnexRead :: GitConfig -> IO AnnexRead
@ -152,6 +154,8 @@ newAnnexRead c = do
, forcebackend = Nothing
, forcenumcopies = Nothing
, forcemincopies = Nothing
, useragent = Nothing
, desktopnotify = mempty
}
-- Values that can change while running an Annex action.
@ -190,14 +194,12 @@ data AnnexState = AnnexState
, fields :: M.Map String String
, cleanupactions :: M.Map CleanupAction (Annex ())
, sentinalstatus :: Maybe SentinalStatus
, useragent :: Maybe String
, errcounter :: Integer
, skippedfiles :: Bool
, adjustedbranchrefreshcounter :: Integer
, unusedkeys :: Maybe (S.Set Key)
, tempurls :: M.Map Key URLString
, existinghooks :: M.Map Git.Hook.Hook Bool
, desktopnotify :: DesktopNotify
, workers :: Maybe (TMVar (WorkerPool (AnnexState, AnnexRead)))
, cachedcurrentbranch :: (Maybe (Maybe Git.Branch, Maybe Adjustment))
, cachedgitenv :: Maybe (AltIndexFile, FilePath, [(String, String)])
@ -245,14 +247,12 @@ newAnnexState c r = do
, fields = M.empty
, cleanupactions = M.empty
, sentinalstatus = Nothing
, useragent = Nothing
, errcounter = 0
, skippedfiles = False
, adjustedbranchrefreshcounter = 0
, unusedkeys = Nothing
, tempurls = M.empty
, existinghooks = M.empty
, desktopnotify = mempty
, workers = Nothing
, cachedcurrentbranch = Nothing
, cachedgitenv = Nothing