GETCONFIG name fix
authorJoey Hess <joeyh@joeyh.name>
Mon, 9 Mar 2020 16:38:04 +0000 (12:38 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 9 Mar 2020 16:38:04 +0000 (12:38 -0400)
Fix regression that prevented external special remotes from using GETCONFIG
to query values like "name". (Introduced in version 7.20200202.7.)

CHANGELOG
Remote/External.hs
Types/RemoteConfig.hs
doc/bugs/git-annex_no_longer_provides_remote_name_with_GETCONFIG_name.mdwn

index cd41f23c8fde34ea124fee8bff70086a7c24b998..43994931e1ac9d4e315b89ddcfbf8e28d34602c4 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,7 @@
 git-annex (8.20200227) UNRELEASED; urgency=medium
 
+  * Fix regression that prevented external special remotes from using
+    GETCONFIG to query values like "name". (Introduced in version 7.20200202.7.)
   * Improve behavior when a directory git-annex is writing to gets
     unmounted. Previously it could in some cases re-create the mount point
     and directory tree, and even write object contents to the wrong disk.
index 0dfa449a8acd55d041a2d8bcb0ec7e65dbfc63a1..63740216fe7e69408ed7f3955e255c707bef7437 100644 (file)
@@ -424,9 +424,9 @@ handleRequest' st external req mp responsehandler
                        modifyTVar' (externalConfigChanges st) $ \f ->
                                f . M.insert (Accepted setting) (Accepted value)
        handleRemoteRequest (GETCONFIG setting) = do
-               value <- fromMaybe ""
+               value <- maybe "" fromProposedAccepted
                        . (M.lookup (Accepted setting))
-                       . getRemoteConfigPassedThrough
+                       . unparsedRemoteConfig
                        <$> liftIO (atomically $ readTVar $ externalConfig st)
                send $ VALUE value
        handleRemoteRequest (SETCREDS setting login password) = case (externalUUID external, externalGitConfig external) of
index 073181e27d1927c353227b46577d745fb98191d8..7b9662c958cb458269a927aae38321be351d641d 100644 (file)
@@ -23,8 +23,9 @@ type RemoteConfig = M.Map RemoteConfigField (ProposedAccepted String)
 
 {- Before being used a RemoteConfig has to be parsed. -}
 data ParsedRemoteConfig = ParsedRemoteConfig
-       (M.Map RemoteConfigField RemoteConfigValue)
-       RemoteConfig
+       { parsedRemoteConfigMap :: M.Map RemoteConfigField RemoteConfigValue
+       , unparsedRemoteConfig :: RemoteConfig
+       }
 
 {- Remotes can have configuration values of many types, so use Typeable
  - to let them all be stored in here. -}
index 53005c9ae21c658527f89a4555a235570a898eea..ef50c87a948b86cfaf0f7530e28bb830cfb378f2 100644 (file)
@@ -18,3 +18,4 @@ There is no day that ends without me being grateful for git-annex ;-)
 [[!meta author=mih]]
 [[!tag projects/datalad]]
 
+> [[fixed|done]] --[[Joey]]