Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@emmax86
Copy link
Contributor

@emmax86 emmax86 commented Feb 28, 2018

Some repositories (i.e. VSTS repos) may have spaces in the repo path. The Git CLI is successfully able to handle this special case by unescaping special characters when constructing a command, e.g. git-upload-pack '/Project with Spaces/_ssh/Repo with Spaces'. The proposed change would ensure the same in libgit2.

@emmax86 emmax86 changed the title Unescape special characters in SSH repo names Unescape special characters in SSH repo paths Mar 1, 2018
src/netops.c Outdated
*password = gitno_unescape(git__substrdup(colon+1, u.field_data[UF_USERINFO].len - (colon+1-_userinfo)));
GITERR_CHECK_ALLOC(*password);
} else {
*username = git__substrdup(_userinfo, u.field_data[UF_USERINFO].len);
Copy link
Member

Choose a reason for hiding this comment

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

While you're in here, can you unescape this as well? It should have been unescaped the whole time, but was overlooked.

@ethomson
Copy link
Member

ethomson commented Mar 3, 2018

So thanks for raising this issue. While reviewing this, it feels to me like gitno_extract_url_parts is sort of deficient in a few ways. I've opened #4563 to fix a few of these issues.

I think that we should consider taking this PR for the next release. We should perhaps think about cherry-picking df96f70 to avoid the unnecessary malloc, but I'm happy either way, tbqh.

@ethomson
Copy link
Member

Thanks for this; I've manually merged it.

@ethomson ethomson closed this Mar 20, 2018
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.

2 participants