var co = new CloneOptions();
co.CredentialsProvider= (url, fromUrl, types) => new UsernamePasswordCredentials { Username = "My_LDAP_User_Name", Password = "My_HTTP_Password_generated_from_Gerrit" };
Repository.Clone("http://GerritServerURL:8080/gerrit/playground", @"D:\GitPlay\Playground", co);
Repository.Clone("http://GerritServerURL:8080/a/gerrit/playground", @"D:\GitPlay\Playground", co);
or if the latter:Repository.Clone("http://GerritServerURL:8080/gerrit/a/playground", @"D:\GitPlay\Playground", co);
Repository.Clone("http://GerritServerURL:8080/gerrit/a/playground", @"D:\GitPlay\Playground", co);
I still get "Request failed with status code: 401". Could you please suggest other alternatives?Hello Hugo,
In the example I quoted, 'gerrit' is just the webapp path and the repository name is 'playground'.
I tried your suggestion -Repository.Clone("http://GerritServerURL:8080/gerrit/a/playground", @"D:\GitPlay\Playground", co);
I still get "Request failed with status code: 401". Could you please suggest other alternatives?
Cheers,
AnanthaOn Thursday, 18 May 2017 16:13:38 UTC+5:30, Hugo Arès wrote:Try adding "/a" in the url to force authentication.
I am not sure if project is named "gerrit/playground" or just "playground" and "/gerrit" is the webapp path.
If the former, try:Repository.Clone("http://GerritServerURL:8080/a/gerrit/playground", @"D:\GitPlay\Playground", co);
or if the latter:Repository.Clone("http://GerritServerURL:8080/gerrit/a/playground", @"D:\GitPlay\Playground", co);
On Thursday, May 18, 2017 at 1:30:30 AM UTC-4, Anantha Madhava wrote:Hello Gurus,
The query is not directly related to Gerrit but the access to Git repos hosted on Gerrit.
I am using Gerrit version V2.11.2 on Windows 2008 server R2 edition.
I have a need to access the Git repositories hosted on Gerrit through libgit2sharp V0.23.1.
Here's the code snippet I used to clone:
var co = new CloneOptions();
co.CredentialsProvider= (url, fromUrl, types) => new UsernamePasswordCredentials { Username = "My_LDAP_User_Name", Password = "My_HTTP_Password_generated_from_Gerrit" };
Repository.Clone("http://GerritServerURL:8080/gerrit/playground", @"D:\GitPlay\Playground", co);
For this, I get the error - "Request failed with status code: 401"
However, when I perform Git clone through Git Bash for the same repo and same credentials, the clone succeeds.
The above code snippet also works for a Git repository hosted on Gitea server I have.
Please suggest, what config changes I need to do in Gerrit to make it work?
Cheers,
Anantha
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.