From 1615114345988fa488ae3e8e98dcbee6c62bb2a4 Mon Sep 17 00:00:00 2001 From: TANIGUCHI Masaya Date: Tue, 26 Dec 2023 14:07:37 +0000 Subject: [PATCH] Avoid git reset for the parent directory --- plugin/jetpack.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/jetpack.vim b/plugin/jetpack.vim index f5a67a7..cdeeb08 100644 --- a/plugin/jetpack.vim +++ b/plugin/jetpack.vim @@ -230,6 +230,10 @@ function! jetpack#clean_plugins() abort return endif for [pkg_name, pkg] in items(s:declared_packages) + if !isdirectory(pkg.path . '/.git') + call delete(pkg.path, 'rf') + continue + endif if isdirectory(pkg.path) call system(printf('git -C %s reset --hard', pkg.path)) let branch = trim(system(printf('git -C %s rev-parse --abbrev-ref %s', pkg.path, pkg.commit)))