junegunn / vim-plug

:hibiscus: Minimalist Vim Plugin Manager
https://junegunn.github.io/vim-plug/
MIT License
33.94k stars 1.93k forks source link

Error 'Invalid URI: master' occurred when running :PlugUpdate on Windows #890

Closed IceNature closed 4 years ago

IceNature commented 4 years ago

The command :PlugUpdate showes error message 'Invalid URI: master` for every plugins

Updated. Elapsed time: 39.204868 sec.
[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]

- Finishing ... Done!
x delimitMate:
    Invalid URI: master
    Expected:    https://git::@github.com/Raimondi/delimitMate.git
    PlugClean required.
x indentLine:
    Invalid URI: master
    Expected:    https://git::@github.com/Yggdroot/indentLine.git
    PlugClean required.
x ncm2-jedi:
    Invalid URI: master
    Expected:    https://git::@github.com/ncm2/ncm2-jedi.git
    PlugClean required.
x neco-vim:
    Invalid URI: master
    Expected:    https://git::@github.com/Shougo/neco-vim.git
    PlugClean required.
...

I tried :PlugClean and then :PlugInstall, vim-plug deleted and reinstalled all plugins correctly without any error. But after that, :PlugUpdate still showed the same error as above. I do not set any global options of vim-plug in my vimrc. This happens in both GVim 8.1 2102 and NeoVim 0.4.2 with Python 3.7.3 64bit on Windows 10 1903 x64 18362.418 I use Git version 2.23.0. The command

git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url

returns, for example,

master
https://git::@github.com/taxilian/a.vim.git

NVIM v0.4.2
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe /DWIN32 /D_WINDOWS /W3 /MD /Zi /O2 /Ob1 /DNDEBUG -DMIN_LOG_LEVEL=3 /W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -D_WIN32_WINNT=0x0600 -DINCLUDE_GENERATED_DECLARATIONS -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -IC:/projects/neovim/build/config -IC:/projects/neovim/src -IC:/projects/nvim-deps/usr/include -IC:/projects/neovim/build/src/nvim/auto -IC:/projects/neovim/build/include
Compiled by appveyor@APPVYR-WIN

Features: -acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM\sysinit.vim"
  fall-back for $VIM: "C:/Program Files/nvim/share/nvim"

Run :checkhealth for more info
xaljer commented 4 years ago

same as #876, fails since https://github.com/junegunn/vim-plug/commit/226d6abeb2f02bcd8f5b11288543259fa2e02962.

IceNature commented 4 years ago

same as #876, fails since 226d6ab.

I think they may be different problems. #876 is caused by powershell, but here I use cmd

janlazo commented 4 years ago

@IceNature Do you have custom shell settings for cmd.exe?

IceNature commented 4 years ago

@janlazo No, but you remind me that I am using the Git in MSYS2 with a batch wrapper to make it run conveniently under cmd.

@ECHO OFF
setlocal enableextensions enabledelayedexpansion
SET MSYS2=%~dp0%..\usr\bin
FOR %%i IN ("git.exe") DO SET GIT=%%~$PATH:i
IF NOT EXIST "%GIT%" (
    SET "PATH=%MSYS2%;%PATH%"
)

if "%1" equ "rev-parse" goto rev_parse
git.exe %*
goto :END_LOCAL
:rev_parse
for /f "delims=" %%1 in ('git.exe %*') do cygpath -w "%%1"

:END_LOCAL
endlocal
@ECHO ON

I tried to run

:echo system('git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url')

in a git repo or run the temp file created by vim-plug in my temp directory directly with cmd /c. Both of them work correctly. It returns two line, one is master, the other is the URI But if I use the system() to run the temp batch file, just as s:system() in plug.vim do, it only returns one line, and I do not know why the second line is missing