Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shellescaping for git commands on Windows #909

Merged
merged 2 commits into from
Dec 2, 2019

Conversation

janlazo
Copy link
Contributor

@janlazo janlazo commented Nov 21, 2019

I had issues installing/updating my plugins recently (ie. Invalid URI, bad index on git) but it happens randomly for the same config. My guess is that vim-plug doesn't cleanup its temporary resources well on Windows and the shellescaping is not done correctly for all shell commands 😅 so issues like #690, #852, #908, #890 happen.

Close #890

It was using s:esc() which escapes spaces with a backslash.
This does not work on Windows.
&shell could be escaped on because of spaces.
See patch-8.0.1455 and related 8.1.x patches that address this
for $SHELL on Unix and git-bash on Windows.
@@ -1169,7 +1169,7 @@ function! s:job_abort()
silent! call job_stop(j.jobid)
endif
if j.new
call s:system('rm -rf ' . plug#shellescape(g:plugs[name].dir))
call s:rm_rf(g:plugs[name].dir)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s:rm_rf(dir) cannot run delete(a:dir, 'rf') without stalling the build. I guess it fails in the terminal.

@janlazo janlazo merged commit 93b7025 into junegunn:master Dec 2, 2019
@janlazo janlazo deleted the shellescape-git branch December 2, 2019 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error 'Invalid URI: master' occurred when running :PlugUpdate on Windows
1 participant