From b736e457b322c518c341256763c6373345aeb7e2 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 13 Nov 2021 16:22:34 -0500 Subject: [PATCH] Provide FugitiveRemote() --- plugin/fugitive.vim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 7e5fa64..09236ae 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -210,6 +210,23 @@ function! FugitiveRemoteUrl(...) abort return call('fugitive#RemoteUrl', a:000) endfunction +" FugitiveRemote() returns a data structure parsed from the remote URL. +" For example, for remote URL is "https://me@example.com:1234/repo.git", +" the returned dictionary will contain the following: +" +" * "scheme": "https" +" * "authority": "user@example.com:1234" +" * "path": "/repo.git" (for SSH URLs this may be a relative path) +" * "host": "example.com:1234" +" * "hostname": "example.com" +" * "port": "1234" +" * "user": "me" +" * "path": "/repo.git" +" * "url": "https://me@example.com:1234/repo.git" +function! FugitiveRemote(...) abort + return call('fugitive#Remote', a:000) +endfunction + " FugitiveDidChange() triggers a FugitiveChanged event and reloads the summary " buffer for the current or given buffer number's repository. You can also " give the result of a FugitiveExecute() and that context will be made