Skip to content

Conversation

graemefoster
Copy link
Contributor

LibGit2Sharp cannot build pull-requests on private repos on V17 as it was unable to pass credentials in the CreateFakeBranchPointingAtThePullRequestTip method.

This is fixed in v18 which provides an option to pass credentials to Network.ListReferences
This PR upgrades LibGit2Sharp to enable this method to be used.

@nulltoken
Copy link
Contributor

@graemefoster Wow! Thanks a lot for this.

Looks pretty fine, but I'll take a deeper look later today.

Just a nitpick: Could you please tweak your PR so that it makes TeamCity happier?

@graemefoster
Copy link
Contributor Author

No worries - it'll have to be tomorrow though. Pretty late here now and nice shut the computer off for the night.

Cheers

Graeme

Sent from my iPhone

On 6 Jun 2014, at 10:53 pm, "nulltoken" <notifications@github.commailto:notifications@github.com> wrote:

@graemefosterhttps://github.com/graemefoster Wow! Thanks a lot for this.

Looks pretty fine, but I'll take a deeper look later today.

Just a nitpick: Could you please tweak your PR so that it makes TeamCity happier?

Reply to this email directly or view it on GitHubhttps://github.com//pull/188#issuecomment-45345459.

{
var remote = repo.Network.Remotes.Single();
var remoteTips = repo.Network.ListReferences(remote);
var credentials = string.IsNullOrEmpty(arguments.Username) ? (Credentials) new DefaultCredentials() : new UsernamePasswordCredentials()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure you're really willing to use DefaultCredentials. Its intended usage is to provide the "default" credentials (currently logged-in user information) via NTLM or SPNEGO authentication.

If you're rather after not providing any kind of credentials, just pass in null. That should work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did wonder about that one - cool will change it to either uname / pwd, or null.

Sent from my iPhone

On 7 Jun 2014, at 3:58 am, "nulltoken" <notifications@github.commailto:notifications@github.com> wrote:

In GitVersionCore/BuildServers/GitHelper.cs:

     {
         var remote = repo.Network.Remotes.Single();
  •        var remoteTips = repo.Network.ListReferences(remote);
    
  •        var credentials = string.IsNullOrEmpty(arguments.Username) ? (Credentials) new DefaultCredentials() : new UsernamePasswordCredentials()
    

I'm not sure you're really willing to use DefaultCredentials. It's intended usage is to provide the "default" credentials (currently logged-in user information) via NTLM or SPNEGO authentication.

If you're rather after not providing any kind of credentials, just pass in null. That should work.

Reply to this email directly or view it on GitHubhttps://github.com//pull/188/files#r13507607.

graemefoster and others added 2 commits June 7, 2014 11:13
…dentials when username and password are present
To fix compile issue
@JakeGinnivan
Copy link
Contributor

@nulltoken this is all passing on TeamCity now, happy for it to be merged?

nulltoken added a commit that referenced this pull request Jun 9, 2014
…edentialsForBuildingPullRequests

Upgrade libgit2sharp
@nulltoken nulltoken merged commit c5e8936 into GitTools:master Jun 9, 2014
@nulltoken
Copy link
Contributor

@graemefoster ✨ ✨ ✨

@graemefoster
Copy link
Contributor Author

Nice :) my first merged PR into an open source project!

Sent from my iPhone

On 10 Jun 2014, at 3:55 am, "nulltoken" <notifications@github.commailto:notifications@github.com> wrote:

Merged #188#188.

Reply to this email directly or view it on GitHubhttps://github.com//pull/188#event-129496129.

@robdmoore
Copy link

🍰

@JakeGinnivan
Copy link
Contributor

Nice! Once we get the Command line and ruby gem builds running we will release 1.1 with this in it. Cheers Grae!

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.

4 participants