diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-09-07 13:45:31 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-09-07 13:48:44 -0400 |
commit | d910a94df7d6f5c87897c248586cb65523457f99 (patch) | |
tree | 692446ec624e63ac8fa4aec72f0b5ee8e5d13723 /Remote/List.hs | |
parent | 7bd9a9cad8b413f4b09f9ab11a9d6d7ce72b8336 (diff) |
prevent exporttree=yes on remotes that don't support exports
Don't allow "exporttree=yes" to be set when the special remote
does not support exports. That would be confusing since the user would
set up a special remote for exports, but `git annex export` to it would
later fail.
This commit was supported by the NSF-funded DataLad project.
Diffstat (limited to 'Remote/List.hs')
-rw-r--r-- | Remote/List.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Remote/List.hs b/Remote/List.hs index a5e305622..2dc5e4823 100644 --- a/Remote/List.hs +++ b/Remote/List.hs @@ -18,6 +18,7 @@ import Types.Remote import Annex.UUID import Remote.Helper.Hooks import Remote.Helper.ReadOnly +import Remote.Helper.Export import qualified Git import qualified Git.Config @@ -42,7 +43,7 @@ import qualified Remote.Hook import qualified Remote.External remoteTypes :: [RemoteType] -remoteTypes = +remoteTypes = map adjustExportableRemoteType [ Remote.Git.remote , Remote.GCrypt.remote , Remote.P2P.remote @@ -100,8 +101,9 @@ remoteGen m t r = do u <- getRepoUUID r gc <- Annex.getRemoteGitConfig r let c = fromMaybe M.empty $ M.lookup u m - mrmt <- generate t r u c gc - return $ adjustReadOnly . addHooks <$> mrmt + generate t r u c gc >>= maybe + (return Nothing) + (Just <$$> adjustExportable . adjustReadOnly . addHooks) {- Updates a local git Remote, re-reading its git config. -} updateRemote :: Remote -> Annex (Maybe Remote) |