before updating export remotes.
* lookupkey: Added --ref option.
* Support being built with crypton rather than cryptonite.
+ * enableremote: Avoid overwriting existing git remote when passed the uuid
+ of a specialremote that was earlier initialized with the same name.
-- Joey Hess <id@joeyh.name> Mon, 28 Aug 2023 13:10:17 -0400
performSpecialRemote :: PerformSpecialRemote
performSpecialRemote t u oldc c gc mcu = do
+ -- Avoid enabling a special remote if there is another remote
+ -- with the same name.
+ case SpecialRemote.lookupName c of
+ Nothing -> noop
+ Just name -> do
+ rs <- Remote.remoteList
+ case filter (\rmt -> Remote.name rmt == name) rs of
+ (rmt:_) | Remote.uuid rmt /= u ->
+ giveup $ "Not overwriting currently configured git remote named \"" ++ name ++ "\""
+ _ -> noop
(c', u') <- R.setup t (R.Enable oldc) (Just u) Nothing c gc
next $ cleanupSpecialRemote t u' c' mcu
(initremote does check if there's already a remote with the same name, and
refuses to overwrite it).
+
+> [[fixed|done]] --[[Joey]]
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2023-09-22T17:05:28Z"
+ content="""
+The behavior in the first case has changed, it now displays:
+
+ enableremote (normal) foo ok
+
+And the normal git remote is left as-is. Which seems more or less
+reasonable.
+
+The behavior in the second case (passing the uuid) is still as described.
+
+I've fixed that to instead fail with:
+
+ git-annex: Not overwriting currently configured git remote named "foo"
+"""]]