Fix origin url handling in fugitive.vim plugin

Properly removes .git at the end of URL when generating PR url.
pull/1/head
Ensar Sarajčić 2021-01-14 14:13:40 +01:00
parent 4eb7b710a6
commit 3315031905
1 changed files with 1 additions and 0 deletions

View File

@ -14,6 +14,7 @@ endfunction
" Hardcoded to use 'origin' remote
function! s:GetPrUrl()
let origin_url = fugitive#RemoteUrl('origin')
let origin_url = substitute(l:origin_url, '\.git$', '', '')
let origin_url = substitute(l:origin_url, ':', '/', '')
let origin_url = substitute(l:origin_url, 'git@', 'https://', '')
let pr_url = l:origin_url . '/compare/' . FugitiveHead() . '?expand=1'