make remoteKeyToRemoteName safer
If it's passed a ConfigKey such as annex.version, avoid returning an empty remote name and return Nothing instead. Also, foo.bar.baz is not treated as a remote named "bar".
This commit is contained in:
parent
5cb05c43c9
commit
0e830b6bb5
4 changed files with 20 additions and 14 deletions
|
@ -449,8 +449,8 @@ completeRemotes = completer $ mkCompleter $ \input -> do
|
|||
r <- maybe (pure Nothing) (Just <$$> Git.Config.read)
|
||||
=<< Git.Construct.fromCwd
|
||||
return $ filter (input `isPrefixOf`) $
|
||||
map remoteKeyToRemoteName $
|
||||
filter isRemoteKey $
|
||||
mapMaybe remoteKeyToRemoteName $
|
||||
filter isRemoteUrlKey $
|
||||
maybe [] (M.keys . config) r
|
||||
|
||||
completeBackends :: HasCompleter f => Mod f a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue