Skip to content

Commit

Permalink
Avoid git reset for the parent directory
Browse files Browse the repository at this point in the history
  • Loading branch information
tani committed Dec 26, 2023
1 parent 245d6cb commit 1615114
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugin/jetpack.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 1615114

Please sign in to comment.