Skip to content

Support libssh2 based callbacks#2182

Closed
zentron wants to merge 1 commit intolibgit2:masterfrom
OctopusDeploy:robe/custom-build
Closed

Support libssh2 based callbacks#2182
zentron wants to merge 1 commit intolibgit2:masterfrom
OctopusDeploy:robe/custom-build

Conversation

@zentron
Copy link
Contributor

@zentron zentron commented Mar 16, 2026

This PR is not intended to be merged as-is


<PropertyGroup>
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">net472;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">net10.0</TargetFrameworks>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bunch of changes to get it building locally

@@ -0,0 +1,141 @@

Copy link
Contributor Author

@zentron zentron Mar 16, 2026

Choose a reason for hiding this comment

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

This methods are required to be able to call down into the c libraries methods that are only available when using libssh2. The files in this class can be properly tidied up and split up before merge

private static string nativeLibraryPath;
private static bool nativeLibraryPathLocked;
private static readonly string nativeLibraryDefaultPath = null;
private static readonly string nativeLibraryDefaultPath = "/Users/robert/Development/Sandbox/libgit2/build";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Obviously not something to merge, just that helped testing against my local build of libgit2

/// <summary>
/// Options controlling ListRemote behavior.
/// </summary>
public sealed class ListRemoteOptions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New ListRemoteOptions required to get appropriate handlers on the network list operation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can probably be put in as its own PR back into the upstream repo as its not really dependant on anything ssh

Ensure.ArgumentNotNull(remote, "remote");

return ListReferencesInternal(remote.Url, null, new ProxyOptions());
var options = new ListRemoteOptions()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are a bunch of overloads in this network class to utilize the new ListRemoteOptions, these dont necessarily need to be implemented exactly like this

types |= SupportedCredentialTypes.Default;
}

if (credTypes.HasFlag(GitCredentialType.SshKey))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To cater for the different credential callback for ssh commands these new enum values need to be catered for here

@zentron zentron closed this Mar 16, 2026
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.

1 participant