git annex add in adjusted unlocked branch

Cached the current branch lookup just because it seems unnecessary overhead
to run an extra git command per add to query the current branch.
This commit is contained in:
Joey Hess 2016-03-29 13:26:06 -04:00
parent 4226ae1040
commit 42b7ccc89f
Failed to extract signature
4 changed files with 29 additions and 5 deletions

View file

@ -136,6 +136,7 @@ data AnnexState = AnnexState
, workers :: [Either AnnexState (Async AnnexState)]
, concurrentjobs :: Maybe Int
, keysdbhandle :: Maybe Keys.DbHandle
, cachedcurrentbranch :: Maybe Git.Branch
}
newState :: GitConfig -> Git.Repo -> AnnexState
@ -182,6 +183,7 @@ newState c r = AnnexState
, workers = []
, concurrentjobs = Nothing
, keysdbhandle = Nothing
, cachedcurrentbranch = Nothing
}
{- Makes an Annex state object for the specified git repo.