Skip to content

Fixes Git Clone Problem with Spaces - #60573

Merged
João Moreno (joaomoreno) merged 1 commit into
microsoft:masterfrom
scottymcraig:FixGitSpacesIssue
Mar 8, 2019
Merged

João Moreno (joaomoreno) merged 1 commit into
microsoft:masterfrom
scottymcraig:FixGitSpacesIssue

Conversation

@scottymcraig

Copy link
Copy Markdown
Contributor

Fixes #60472. Checks to see if there are spaces in the URL and if so, encodes them.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@joaomoreno João Moreno (joaomoreno) added the git GIT issues label Oct 11, 2018
@joaomoreno João Moreno (joaomoreno) added this to the Backlog milestone Oct 11, 2018
@PeterWone

Peter Wone (PeterWone) commented Oct 16, 2018 •

Copy link
Copy Markdown

I realise my bug report describes spaces, but having seen the fundamental problem (the name can contain characters not allowed in a file path) surely you would fix it like this
await this.exec(parentPath, ['clone', encodeURI(url), folderPath], { cancellationToken });
rather than this proposed solution
await this.exec(parentPath, ['clone', url.includes(' ') ? encodeURI(url) : url, folderPath], { cancellationToken });
which specifically addresses spaces.

@scottymcraig

Copy link
Copy Markdown
Contributor Author

Because encoding a string that already has encoding can cause it to be re-encoded. We just simply want to catch the cases where it comes from Azure DevOps with the spaces. None of the other cloning urls are having problems.

@PeterWone

Copy link
Copy Markdown

Yes and I've just checked, Azure DevOps won't allow any other toxic characters. Just being paranoid! :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we don't really need to check whether the url contains a space. It will be more better, if we are encoding the url even if it is not contains a space.

@scottymcraig

Copy link
Copy Markdown
Contributor Author

Jithil P Ponnan (@MrJithil) We can't do that - see my comment above Peter's

@Glober777

Copy link
Copy Markdown

Can't wait for this issue to be fixed :)

@joaomoreno

Copy link
Copy Markdown
Contributor

Thought exactly the same as Peter Wone (@PeterWone) but I do like the reasoning from Scott Craig (@scottymcraig).

Thanks for the fix!

@joaomoreno
João Moreno (joaomoreno) merged commit 86ca253 into microsoft:master Mar 8, 2019
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

git GIT issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clone in VS Code from AzureDevops fails for project names containing spaces

6 participants