From c67458d189cabfc41267abca790bc453351156a6 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 14 Mar 2012 20:04:44 -0400 Subject: [PATCH] Decamelize s:ExtractGitDir Rule of thumb: reserve camel case for imperative functions. --- plugin/fugitive.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index e710d14..f65bcdb 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -107,7 +107,7 @@ let s:abstract_prototype = {} " }}}1 " Initialization {{{1 -function! s:ExtractGitDir(path) abort +function! s:extract_git_dir(path) abort let path = s:shellslash(a:path) if path =~? '^fugitive://.*//' return matchstr(path,'fugitive://\zs.\{-\}\ze//') @@ -132,7 +132,7 @@ function! s:Detect(path) unlet b:git_dir endif if !exists('b:git_dir') - let dir = s:ExtractGitDir(a:path) + let dir = s:extract_git_dir(a:path) if dir != '' let b:git_dir = dir endif @@ -169,7 +169,7 @@ let s:repo_prototype = {} let s:repos = {} function! s:repo(...) abort - let dir = a:0 ? a:1 : (exists('b:git_dir') && b:git_dir !=# '' ? b:git_dir : s:ExtractGitDir(expand('%:p'))) + let dir = a:0 ? a:1 : (exists('b:git_dir') && b:git_dir !=# '' ? b:git_dir : s:extract_git_dir(expand('%:p'))) if dir !=# '' if has_key(s:repos,dir) let repo = get(s:repos,dir) @@ -1918,7 +1918,7 @@ endfunction function! s:FileRead() try - let repo = s:repo(s:ExtractGitDir(expand(''))) + let repo = s:repo(s:extract_git_dir(expand(''))) let path = s:sub(s:sub(matchstr(expand(''),'fugitive://.\{-\}//\zs.*'),'/',':'),'^\d:',':&') let hash = repo.rev_parse(path) if path =~ '^:'