Fix clone failure on Windows for branch names with single quote
What does this MR do?
This MR makes sure branch names with apostrophes don't break the git clone command on Windows, by wrapping git.BuildInfo.Refspec with single quotes and double quotes.
Why was this MR needed?
Windows Runner fails to clone branches contain a single quote (') in his name with this error:
Preparing the "shell" executor
Using Shell (powershell) executor...
Preparing environment
Running on COMPUTER...
Getting source from Git repository
Fetching changes with git depth set to 1...
Initialized empty Git repository in C:/Gitlab-Runner/builds/IE3tuK7Ck/0/pishel65/example/.git/
Created fresh repository.
fatal: couldn't find remote ref refs/heads/test
Cleaning up project directory and file based variables
ERROR: Job failed: exit status 128
What's the best way to test this MR?
Create a branch with single quote (') in his name (e.g Test's ) ( Make sure GIT_STRATEGY isn't none or empty).
What are the relevant issue numbers?
Edited by Pishel65