After auditing the 8 :GBrowse
providers I'm aware of and discovering 7 of them do not handle URL encoding, I've decided that Fugitive should take responsibility for this. Unfortunately this means you drew the short straw. I am recommending this change to compensate:
diff --git i/autoload/azuredevops.vim w/autoload/azuredevops.vim
index cb65262..3b80920 100644
--- i/autoload/azuredevops.vim
+++ w/autoload/azuredevops.vim
@@ -113,7 +113,7 @@ function! s:add_query_param(url, param_name, param_value) abort
return url_base . query_param
endfunction
-" Snippet from vim-rhubarb (https://github.com/tpope/vim-rhubarb/blob/master/autoload/rhubarb.vim, commit 70713ca)
+" Modified snippet from vim-rhubarb (https://github.com/tpope/vim-rhubarb/blob/master/autoload/rhubarb.vim, commit 70713ca)
function! s:url_encode(str) abort
- return substitute(a:str, '[?@=&<>%#/:+[:space:]]', '\=submatch(0)==" "?"+":printf("%%%02X", char2nr(submatch(0)))', 'g')
+ return substitute(substitute(a:str, '[?@=&<>#/:+[:space:]]\|%\%(\x\x\)\@!', '\=printf("%%%02X", char2nr(submatch(0)))', 'g'), '%20', '+', 'g')
endfunction
This will continue to work on older versions of Fugitive too, except when the filename or commit contains a valid %AB
URL escape. This was previously broken on the other seven providers, and nobody seemed to notice, so I doubt they are very common in practice.