Bugfix: If the UUID of a remote is not known, prevent --from, --to, and other ways of specifying remotes by name from selecting it, since it is not possible to sanely use it.
For example, copy --to such a remote would send the file, but as NoUUID was its uuid, no location log update was done. And drop --from such a remote would not do anything, because NoUUID is not listed in the location log..
This commit is contained in:
parent
59994d3e8f
commit
9769235d6b
2 changed files with 6 additions and 1 deletions
|
@ -81,7 +81,9 @@ byName' "" = return $ Left "no remote specified"
|
|||
byName' n = handle . filter matching <$> remoteList
|
||||
where
|
||||
handle [] = Left $ "there is no available git remote named \"" ++ n ++ "\""
|
||||
handle match = Right $ Prelude.head match
|
||||
handle (match:_)
|
||||
| uuid match == NoUUID = Left $ "cannot determine uuid for " ++ name match
|
||||
| otherwise = Right match
|
||||
matching r = n == name r || toUUID n == uuid r
|
||||
|
||||
{- Looks up a remote by name (or by UUID, or even by description),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue