make --in=here fast
Use the same optimisation for --in=here as has always been used for --in=. rather than the slow code path that unncessarily queries the git-annex branch. It looks like when "here" got added as an alias for "." back in 2012, I forgot about this place. Also sped up some very unlikely ways of referring to the current repository. Note that, this could in some rare corner case cause a behavior change, if the git-annex branch and inAnnex disagree about whether content is present in the local repository. But --in=. already behaved that way, and the truth on the ground should win also.
This commit is contained in:
parent
4ad33e7524
commit
d1a0c7b16f
2 changed files with 15 additions and 7 deletions
14
Limit.hs
14
Limit.hs
|
@ -110,15 +110,15 @@ matchMagic limitname _ _ Nothing _ =
|
|||
{- Adds a limit to skip files not believed to be present
|
||||
- in a specfied repository. Optionally on a prior date. -}
|
||||
addIn :: String -> Annex ()
|
||||
addIn s = addLimit =<< mk
|
||||
addIn s = do
|
||||
u <- Remote.nameToUUID name
|
||||
hereu <- getUUID
|
||||
addLimit $ if u == hereu && null date
|
||||
then use inhere
|
||||
else use (inuuid u)
|
||||
where
|
||||
(name, date) = separate (== '@') s
|
||||
mk
|
||||
| name == "." = if null date
|
||||
then use inhere
|
||||
else use . inuuid =<< getUUID
|
||||
| otherwise = use . inuuid =<< Remote.nameToUUID name
|
||||
use a = return $ Right $ \notpresent -> checkKey (a notpresent)
|
||||
use a = Right $ checkKey . a
|
||||
inuuid u notpresent key
|
||||
| null date = do
|
||||
us <- Remote.keyLocations key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue