motiejus/dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.jakstys.lt/motiejus/dotfiles.git
Log | Tree | Refs | README | LICENSE

commit 35f94eef48320779a1bb2c32caa09fb66a85a71d (tree)
parent c118dabb89b6e7e42383d4cf6f426e53bb45279c
Author: Tim Pope <code@tpope.net>
Date:   Sat, 21 Jul 2018 15:43:05 -0400

Make argument to FugitiveTreeForGitDir optional

Diffstat:
Mplugin/fugitive.vim | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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