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 5e5ce843ea923a01609695df486e21e91de16f47 (tree)
parent a03444404a3710a1427e34883deedd5669acab21
Author: Tim Pope <code@tpope.net>
Date:   Wed, 24 Mar 2021 18:56:49 -0400

Automatically mkdir when editing .git/info/exclude

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

diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim @@ -3807,6 +3807,15 @@ function! s:StageIgnore(lnum1, lnum2, count) abort call extend(paths, info.relative) endfor call map(paths, '"/" . v:val') + if !a:0 + let dir = fugitive#Find('.git/info/') + if !isdirectory(dir) + try + call mkdir(dir) + catch + endtry + endif + endif exe 'Gsplit' (a:count ? '.gitignore' : '.git/info/exclude') let last = line('$') if last == 1 && empty(getline(1))