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/Directory.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/Directory.hs')
-rw-r--r-- | Remote/Directory.hs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Remote/Directory.hs b/Remote/Directory.hs index 512ba1cef..22413b7e9 100644 --- a/Remote/Directory.hs +++ b/Remote/Directory.hs @@ -33,18 +33,19 @@ import Utility.Metered import Utility.Tmp remote :: RemoteType -remote = RemoteType { - typename = "directory", - enumerate = const (findSpecialRemotes "directory"), - generate = gen, - setup = exportableRemoteSetup directorySetup -} +remote = RemoteType + { typename = "directory" + , enumerate = const (findSpecialRemotes "directory") + , generate = gen + , setup = directorySetup + , exportSupported = exportIsSupported + } gen :: Git.Repo -> UUID -> RemoteConfig -> RemoteGitConfig -> Annex (Maybe Remote) gen r u c gc = do cst <- remoteCost gc cheapRemoteCost let chunkconfig = getChunkConfig c - exportableRemote $ specialRemote c + return $ Just $ specialRemote c (prepareStore dir chunkconfig) (retrieve dir chunkconfig) (simplyPrepare $ remove dir) @@ -61,8 +62,7 @@ gen r u c gc = do , checkPresent = checkPresentDummy , checkPresentCheap = True , exportActions = ExportActions - { exportSupported = return True - , storeExport = storeExportDirectory dir + { storeExport = storeExportDirectory dir , retrieveExport = retrieveExportDirectory dir , removeExport = removeExportDirectory dir , checkPresentExport = checkPresentExportDirectory dir |