ignore case when parsing name

This commit is contained in:
gmarik 2011-04-23 01:00:39 -05:00
parent 1599927a43
commit c8d17b1cc6

View File

@ -40,13 +40,13 @@ endf
func! s:parse_name(arg) func! s:parse_name(arg)
let arg = a:arg let arg = a:arg
if arg =~ '^\s*\(gh\|github\):\S\+' if arg =~? '^\s*\(gh\|github\):\S\+'
\ || arg =~ '^\w[a-z0-9-]\+/[^/]\+$' \ || arg =~? '^\w[a-z0-9-]\+/[^/]\+$'
let uri = 'https://github.com/'.split(arg, ':')[-1] let uri = 'https://github.com/'.split(arg, ':')[-1]
let name = substitute(split(uri,'\/')[-1], '\.git\s*$','','i') let name = substitute(split(uri,'\/')[-1], '\.git\s*$','','i')
elseif arg =~ '^\s*\(git@\|git://\)\S\+' elseif arg =~? '^\s*\(git@\|git://\)\S\+'
\ || arg =~ '(file|https\?)://' \ || arg =~? '(file|https\?)://'
\ || arg =~ '\.git\s*$' \ || arg =~? '\.git\s*$'
let uri = arg let uri = arg
let name = split( substitute(uri,'/\?\.git\s*$','','i') ,'\/')[-1] let name = split( substitute(uri,'/\?\.git\s*$','','i') ,'\/')[-1]
else else