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 0cb30541ec7e71b9558e164f100fe083ecd816c6 (tree)
parent 190fe2a4cf35b4840e7727fae0263488567742e8
Author: Emily Strickland <code@emily.st>
Date:   Sun,  2 Mar 2014 18:21:48 -0800

Look for $GIT_DIR and $GIT_WORK_TREE

There are rare situations where a user has manually specified what they
wish to use as their work-tree directory, and even rarer situations
where the user wishes the Git directory to be customized. In the case
the user has set these using environment variables, vim-fugitive takes
advantage of these settings in order to set up.

Note that git-config(1) allows setting the work-tree and Git dir in
a number of ways (see the core.worktree) setting. This change only
respects the environment variable method, not the config file method.

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

diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim @@ -139,6 +139,9 @@ function! fugitive#extract_git_dir(path) abort if index(split($GIT_CEILING_DIRECTORIES, ':'), root) >= 0 break endif + if root ==# $GIT_WORK_TREE && fugitive#is_git_dir($GIT_DIR) + return $GIT_DIR + endif let dir = s:sub(root, '[\/]$', '') . '/.git' let type = getftype(dir) if type ==# 'dir' && fugitive#is_git_dir(dir)