Skip to content

Instantly share code, notes, and snippets.

@gasparnagy
Last active June 2, 2016 19:59
Show Gist options
  • Save gasparnagy/7449059 to your computer and use it in GitHub Desktop.
Save gasparnagy/7449059 to your computer and use it in GitHub Desktop.
Microsoft.TeamFoundation.Git.CoreServices.dll!Microsoft.TeamFoundation.Git.CoreServices.TfsSmartSubtransport.TfsSmartTransportStream.Read(System.IO.Stream dataStream, long length, out long bytesRead)
LibGit2Sharp.dll!LibGit2Sharp.SmartSubtransportStream.EntryPoints.Read(System.IntPtr stream, System.IntPtr buffer, System.UIntPtr buf_size, out System.UIntPtr bytes_read)
[Native to Managed Transition]
git2-msvstfs.dll!0f442ec7()
git2-msvstfs.dll!0f3fab42()
[Managed to Native Transition]
LibGit2Sharp.dll!LibGit2Sharp.Core.Proxy.git_clone(string url, string workdir, LibGit2Sharp.Core.GitCloneOptions opts)
LibGit2Sharp.dll!LibGit2Sharp.Repository.Clone(string sourceUrl, string workdirPath, bool bare, bool checkout, LibGit2Sharp.Handlers.TransferProgressHandler onTransferProgress, LibGit2Sharp.Handlers.CheckoutProgressHandler onCheckoutProgress, LibGit2Sharp.Credentials credentials)
Microsoft.TeamFoundation.Git.CoreServices.dll!Microsoft.TeamFoundation.Git.CoreServices.SccCloneJob.Execute()
class TfsGitSession : IDisposable
{
IDisposable httpsDefinition;
public TfsGitSession()
{
// we need to perform this... through reflection
//httpsDefinition = new SmartSubtransportDefinition<TfsSmartSubtransport>("https://", 2);
var tfsSmartSubTransportType = Type.GetType("Microsoft.TeamFoundation.Git.CoreServices.TfsSmartSubtransport, Microsoft.TeamFoundation.Git.CoreServices, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", true);
var smartSubtransportDefinitionType = typeof(SmartSubtransportDefinition<>).MakeGenericType(tfsSmartSubTransportType);
httpsDefinition = (IDisposable)Activator.CreateInstance(smartSubtransportDefinitionType, "https://", 2);
}
public void Dispose()
{
httpsDefinition.Dispose();
}
}
using (new TfsGitSession())
{
Repository.Clone(cloneUrl, localPath);
}
@panuganti
Copy link

I'm trying to use this with latest version of libgit2sharp for NTLM authentication. Type SmartSubtransportDefinition<> is not found in LibGit2Sharp. Can you please update your gist ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment