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

Fixes Git Clone Problem with Spaces #60573

Merged
merged 1 commit into from
Mar 8, 2019
Merged

Fixes Git Clone Problem with Spaces #60573

merged 1 commit into from
Mar 8, 2019

Conversation

scottymcraig
Copy link
Contributor

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

Copy link

@vikaskyadav vikaskyadav left a comment

Choose a reason for hiding this comment

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

Looks good @scottymcraig

@joaomoreno joaomoreno added the git GIT issues label Oct 11, 2018
@joaomoreno joaomoreno added this to the Backlog milestone Oct 11, 2018
@PeterWone
Copy link

PeterWone commented Oct 16, 2018

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
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

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

Copy link
Contributor

@MrJithil MrJithil left a comment

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
Contributor Author

@MrJithil We can't do that - see my comment above Peter's

@Glober777
Copy link

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

@joaomoreno
Copy link
Member

Thought exactly the same as @PeterWone but I do like the reasoning from @scottymcraig.

Thanks for the fix!

@joaomoreno joaomoreno merged commit 86ca253 into microsoft:master Mar 8, 2019
@joaomoreno joaomoreno modified the milestones: Backlog, March 2019 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