From 35f94eef48320779a1bb2c32caa09fb66a85a71d Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 21 Jul 2018 15:43:05 -0400 Subject: [PATCH] Make argument to FugitiveTreeForGitDir optional --- plugin/fugitive.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 01c3750..d1d37b6 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -25,8 +25,8 @@ endfunction let s:worktree_for_dir = {} let s:dir_for_worktree = {} -function! FugitiveTreeForGitDir(git_dir) abort - let dir = substitute(s:shellslash(a:git_dir), '/$', '', '') +function! FugitiveTreeForGitDir(...) abort + let dir = substitute(s:shellslash(a:0 ? a:1 : get(b:, 'git_dir', '')), '/$', '', '') if dir =~# '/\.git$' return len(dir) ==# 5 ? '/' : dir[0:-6] endif