git-lfs: remember urls, and autoenable remotes using known urls
* git-lfs: The url provided to initremote/enableremote will now be stored in the git-annex branch, allowing enableremote to be used without an url. initremote --sameas can be used to add additional urls. * git-lfs: When there's a git remote with an url that's known to be used for git-lfs, automatically enable the special remote.
This commit is contained in:
parent
d06b5bcd7b
commit
5877de5e80
9 changed files with 141 additions and 46 deletions
|
@ -34,21 +34,9 @@ findExisting name = do
|
|||
t <- trustMap
|
||||
headMaybe
|
||||
. sortBy (comparing $ \(u, _, _) -> Down $ M.lookup u t)
|
||||
. findByName name
|
||||
. findByRemoteConfig (\c -> lookupName c == Just name)
|
||||
<$> Logs.Remote.readRemoteLog
|
||||
|
||||
findByName :: RemoteName -> M.Map UUID RemoteConfig -> [(UUID, RemoteConfig, Maybe (ConfigFrom UUID))]
|
||||
findByName n = map sameasuuid . filter (matching . snd) . M.toList
|
||||
where
|
||||
matching c = case lookupName c of
|
||||
Nothing -> False
|
||||
Just n'
|
||||
| n' == n -> True
|
||||
| otherwise -> False
|
||||
sameasuuid (u, c) = case M.lookup sameasUUIDField c of
|
||||
Nothing -> (u, c, Nothing)
|
||||
Just u' -> (toUUID u', c, Just (ConfigFrom u))
|
||||
|
||||
newConfig
|
||||
:: RemoteName
|
||||
-> Maybe (Sameas UUID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue