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 6b338bdbcfc379af06ae1be7efdf533a82600477 (tree)
parent 34e2d2538a634a0a820a56994333ffa1fec1bc58
Author: Lech Lorens <lech.lorens@gmail.com>
Date:   Tue, 17 Dec 2013 13:33:07 +0100

Fix slowness when searching for networked git repos under Cygwin.

The algorithm in fugitive#extract_git_dir() is to move upwards in the
file system hierarchy until a sub-directory called .git is found. When
accessing a file on a network share from a Cygwin Vim and the file is not
within a git repo, this eventually causes a check for the existence of
//serverName/.git and //.git. Such checks are extremely slow so let's
avoid them.

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

diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim @@ -130,6 +130,12 @@ function! fugitive#extract_git_dir(path) abort let root = s:shellslash(simplify(fnamemodify(a:path, ':p:s?[\/]$??'))) let previous = "" while root !=# previous + if root =~# '\v^//%([^/]+/?)?$' + " This is for accessing network shares from Cygwin Vim. There won't be + " any git directory called //.git or //serverName/.git so let's avoid + " checking for them since such checks are extremely slow. + break + endif let dir = s:sub(root, '[\/]$', '') . '/.git' let type = getftype(dir) if type ==# 'dir' && fugitive#is_git_dir(dir)