git-remote-annex: support importrree=yes remotes
When exporttree=yes is also set. Probably it would also be possible to support ones with only importtree=yes, by enabling exporttree=yes for the remote only when using git-remote-annex, but let's keep this simple... I'm not sure what gets recorded in .git/annex/ state differently in the two cases that might cause a problem when doing that. Note that the full annex:: urls generated and displayed for such a remote omit the importree=yes. Which is ok, cloning from such an url uses an exporttree=remote, but the git-annex branch doesn't get written by this program, so once the real config is available from the git-annex branch, it will still function as an importree=yes remote.
This commit is contained in:
parent
126d188812
commit
e64add7cdf
3 changed files with 32 additions and 11 deletions
|
@ -87,12 +87,20 @@ remoteList' autoinit = do
|
|||
|
||||
{- Generates a Remote. -}
|
||||
remoteGen :: M.Map UUID RemoteConfig -> RemoteType -> Git.Repo -> Annex (Maybe Remote)
|
||||
remoteGen m t g = do
|
||||
remoteGen = remoteGen' id
|
||||
|
||||
remoteGen'
|
||||
:: (RemoteConfig -> RemoteConfig)
|
||||
-> M.Map UUID RemoteConfig
|
||||
-> RemoteType
|
||||
-> Git.Repo
|
||||
-> Annex (Maybe Remote)
|
||||
remoteGen' adjustconfig m t g = do
|
||||
u <- getRepoUUID g
|
||||
gc <- Annex.getRemoteGitConfig g
|
||||
let cu = fromMaybe u $ remoteAnnexConfigUUID gc
|
||||
let rs = RemoteStateHandle cu
|
||||
let c = fromMaybe M.empty $ M.lookup cu m
|
||||
let c = adjustconfig (fromMaybe M.empty $ M.lookup cu m)
|
||||
generate t g u c gc rs >>= \case
|
||||
Nothing -> return Nothing
|
||||
Just r -> Just <$> adjustExportImport (adjustReadOnly (addHooks r)) rs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue