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

Misc fixes for LibGit2 #18066

Merged
merged 5 commits into from
Aug 18, 2016
Merged

Misc fixes for LibGit2 #18066

merged 5 commits into from
Aug 18, 2016

Conversation

omus
Copy link
Member

@omus omus commented Aug 16, 2016

No description provided.

An SSH URL with a path uses a colon between the host and the path:

	git@github.com:JuliaLang/Example.jl (correct)
	git@github.com/JuliaLang/Example.jl (incorrect)
@@ -160,7 +160,7 @@ function authenticate_userpass(creds::UserPasswordCredentials, libgit2credptr::P
urlusername : username)
userpass = prompt("Password for '$schema$username@$host'", password=true)
end
(creds.user != username) || (creds.pass != userpass) && reset!(creds)
((creds.user != username) || (creds.pass != userpass)) && reset!(creds)
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixes operator precedence issue. Mirrors 1d5a427

@Keno
Copy link
Member

Keno commented Aug 16, 2016

LGTM, thanks!

(?<host>[A-Za-z0-9\-\.]+)
(?:\:(?<port>\d+)?)?
(?<path>.*?)$
"""x
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixes several things with the original regex including:

  • Doesn't fail or absorb password information into the username
  • SSH URLs would have the colon included in the path capture. e.g. "git@github.com:JuliaLang/Example.jl" would have the path ":JuliaLang/Example.jl"
  • Allows more complicated usernames including ones using hypens
  • Switched to using named groups for clarity

@tkelman tkelman added libgit2 The libgit2 library or the LibGit2 stdlib module backport pending 0.5 labels Aug 16, 2016
@kshyatt kshyatt added the kind:bugfix This change fixes an existing bug label Aug 17, 2016
Test was only working for environments which had GitHub SSH keys setup.
Added a new explicit SSH protocol test which generated other changes.
@omus
Copy link
Member Author

omus commented Aug 18, 2016

Travis failure is unrelated to the changes. PR should be ready to go.

@StefanKarpinski StefanKarpinski merged commit a67a95e into JuliaLang:master Aug 18, 2016
@omus omus deleted the libgit2-fixes branch August 18, 2016 20:20
tkelman pushed a commit that referenced this pull request Aug 20, 2016
(cherry picked from commit 2192d19)
ref #18066
tkelman pushed a commit that referenced this pull request Aug 20, 2016
(cherry picked from commit d2bbdd2)
ref #18066
tkelman pushed a commit that referenced this pull request Aug 20, 2016
An SSH URL with a path uses a colon between the host and the path:

	git@github.com:JuliaLang/Example.jl (correct)
	git@github.com/JuliaLang/Example.jl (incorrect)

(cherry picked from commit 749d099)
ref #18066
tkelman pushed a commit that referenced this pull request Aug 20, 2016
Test was only working for environments which had GitHub SSH keys setup.

(cherry picked from commit 1e98a5a)
ref #18066
tkelman pushed a commit that referenced this pull request Aug 20, 2016
Added a new explicit SSH protocol test which generated other changes.

(cherry picked from commit ea8fa25)
ref #18066
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bugfix This change fixes an existing bug libgit2 The libgit2 library or the LibGit2 stdlib module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants