Replace s:extract_name with a single fnamemodify call

This commit is contained in:
Junegunn Choi 2014-07-29 19:08:21 +09:00
parent 58c06ed77e
commit 9bb2da53a0

View file

@ -313,7 +313,7 @@ function! s:add(force, repo, ...)
try try
let repo = s:trim(a:repo) let repo = s:trim(a:repo)
let name = s:extract_name(repo) let name = fnamemodify(repo, ':t:s?\.git$??')
if !a:force && has_key(g:plugs, name) if !a:force && has_key(g:plugs, name)
let s:extended[name] = g:plugs[name] let s:extended[name] = g:plugs[name]
return return
@ -367,10 +367,6 @@ function! s:infer_properties(name, repo)
return properties return properties
endfunction endfunction
function! s:extract_name(repo)
return substitute(fnamemodify(a:repo, ':t'), '\.git$', '', '')
endfunction
function! s:install(...) function! s:install(...)
call s:update_impl(0, a:000) call s:update_impl(0, a:000)
endfunction endfunction