get rid of hardcoded "name" lookups

Support "sameas-name" being set instead.

In RenameRemote, rename which ever of the two is set.
This commit is contained in:
Joey Hess 2019-10-10 13:08:17 -04:00
parent 92ff30df70
commit d1130ea04a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
15 changed files with 45 additions and 14 deletions

View file

@ -24,6 +24,7 @@ import Types.StandardGroups
import Creds
import Assistant.Gpg
import Git.Types (RemoteName)
import Annex.SpecialRemote.Config
import qualified Data.Text as T
import qualified Data.Map as M
@ -195,7 +196,7 @@ enableAWSRemote remotetype uuid = do
case result of
FormSuccess creds -> liftH $ do
m <- liftAnnex readRemoteLog
let name = fromJust $ M.lookup "name" $
let name = fromJust $ lookupName $
fromJust $ M.lookup uuid m
makeAWSRemote enableSpecialRemote remotetype SmallArchiveGroup creds name M.empty
_ -> do