git-remote-annex enableremote to support readonly webdav

* Allow enableremote of an existing webdav special remote that has
  read-only access.
* git-remote-annex: Use enableremote rather than initremote.
This commit is contained in:
Joey Hess 2025-01-07 15:57:20 -04:00
parent e7e479c1f0
commit 5d2aaafa6c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 39 additions and 9 deletions

View file

@ -137,7 +137,9 @@ webdavSetup ss mu mcreds c gc = do
(c', encsetup) <- encryptionSetup c gc
pc <- either giveup return . parseRemoteConfig c' =<< configParser remote c'
creds <- maybe (getCreds pc gc u) (return . Just) mcreds
testDav url creds
case ss of
Init -> testDav url creds
_ -> noop
gitConfigSpecialRemote u c' [("webdav", "true")]
c'' <- setRemoteCredPair ss encsetup pc gc (davCreds u) creds
return (c'', u)