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 bc3ffa6b44378d98f313d83e7b056fe6ae395f3e (tree)
parent 8ecc9b9e11bd341cd9d009e0ac0d083921fae419
Author: Tim Pope <code@tpope.net>
Date:   Tue, 20 Mar 2012 08:16:45 -0400

Guard against blank .git file

Let's see you break it now.

Diffstat:
Mplugin/fugitive.vim | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim @@ -118,7 +118,7 @@ function! fugitive#extract_git_dir(path) abort elseif type ==# 'link' && fugitive#is_git_dir(dir) return resolve(dir) elseif type !=# '' && filereadable(dir) - let line = readfile(dir, 1)[0] + let line = get(readfile(dir, 1), 0, '') if line =~# '^gitdir: ' && fugitive#is_git_dir(line[8:-1]) return line[8:-1] endif