renameremote: Better handling of case where there are multiple special remotes with a name
Instead of renaming one at random, error out and ask that a uuid be specified. Sponsored-by: Brett Eisenberg on Patreon
This commit is contained in:
parent
58afb00f6e
commit
e416635021
5 changed files with 16 additions and 15 deletions
|
@ -30,10 +30,10 @@ import qualified Data.Map as M
|
|||
-
|
||||
- Remotes that are not dead come first in the list
|
||||
- when a name appears multiple times. -}
|
||||
findExisting :: RemoteName -> Annex (Maybe (UUID, RemoteConfig, Maybe (ConfigFrom UUID)))
|
||||
findExisting :: RemoteName -> Annex [(UUID, RemoteConfig, Maybe (ConfigFrom UUID))]
|
||||
findExisting name = do
|
||||
(a, b) <- findExisting' name
|
||||
return (headMaybe (a++b))
|
||||
return (a++b)
|
||||
|
||||
{- Dead remotes with the name are in the second list, all others in the
|
||||
- first list. -}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue