enableremote: Allow type= to be provided when it does not change the type of the special remote

Fixes breakage in datalad test suite
https://github.com/datalad/datalad/issues/7747

Also, revert the change I earlier made to git-annex's own test suite due to
the same problem.
This commit is contained in:
Joey Hess 2025-09-29 10:40:10 -04:00
commit c20b8610b6
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 13 additions and 9 deletions

View file

@ -1918,19 +1918,19 @@ test_gpg_crypto = do
where
testscheme scheme = intmpclonerepo $ test_with_gpg $ \gpgcmd environ -> do
createDirectory (literalOsPath "dir")
let ps =
let initps =
[ "foo"
, "type=directory"
, "encryption=" ++ scheme
, "directory=dir"
, "highRandomQuality=false"
] ++ if scheme `elem` ["hybrid","pubkey"]
then ["keyid=" ++ Utility.Gpg.testKeyId]
else []
let initps = ps ++ [ "type=directory" ]
git_annex' "initremote" initps (Just environ) "initremote"
git_annex_shouldfail' "initremote" initps (Just environ) "initremote should not work when run twice in a row"
git_annex' "enableremote" ps (Just environ) "enableremote"
git_annex' "enableremote" ps (Just environ) "enableremote when run twice in a row"
git_annex' "enableremote" initps (Just environ) "enableremote"
git_annex' "enableremote" initps (Just environ) "enableremote when run twice in a row"
git_annex' "get" [annexedfile] (Just environ) "get of file"
annexed_present annexedfile
git_annex' "copy" [annexedfile, "--to", "foo"] (Just environ) "copy --to encrypted remote"