Fix origin url handling in fugitive.vim plugin
Properly removes .git at the end of URL when generating PR url.pull/1/head
parent
4eb7b710a6
commit
3315031905
|
@ -14,6 +14,7 @@ endfunction
|
||||||
" Hardcoded to use 'origin' remote
|
" Hardcoded to use 'origin' remote
|
||||||
function! s:GetPrUrl()
|
function! s:GetPrUrl()
|
||||||
let origin_url = fugitive#RemoteUrl('origin')
|
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, ':', '/', '')
|
||||||
let origin_url = substitute(l:origin_url, 'git@', 'https://', '')
|
let origin_url = substitute(l:origin_url, 'git@', 'https://', '')
|
||||||
let pr_url = l:origin_url . '/compare/' . FugitiveHead() . '?expand=1'
|
let pr_url = l:origin_url . '/compare/' . FugitiveHead() . '?expand=1'
|
||||||
|
|
Loading…
Reference in New Issue