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
|
@ -64,7 +64,7 @@ seek o = withWords (commandAction . (start o)) (cmdparams o)
|
|||
|
||||
start :: InitRemoteOptions -> [String] -> CommandStart
|
||||
start _ [] = giveup "Specify a name for the remote."
|
||||
start o (name:ws) = ifM (isJust <$> findExisting name)
|
||||
start o (name:ws) = ifM (not . null <$> findExisting name)
|
||||
( giveup $ "There is already a special remote named \"" ++ name ++
|
||||
"\". (Use enableremote to enable an existing special remote.)"
|
||||
, ifM (isJust <$> Remote.byNameOnly name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue