From 91d680ed360555eb007ae658dfeea53c238d549f Mon Sep 17 00:00:00 2001 From: Ben Askren Date: Thu, 17 Nov 2022 17:46:33 -0500 Subject: [PATCH 01/12] iOS working! --- LibGit2Sharp/LibGit2Sharp.csproj | 11 ++++++++++- Targets/GenerateNativeDllName.targets | 18 +++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 57c81cdfb..b8a90c0a9 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netcoreapp3.1 + net6.0;net6.0-ios true LibGit2Sharp brings all the might and speed of libgit2, a native Git implementation, to the managed world of .NET LibGit2Sharp contributors @@ -44,4 +44,13 @@ + + + + + + + + + diff --git a/Targets/GenerateNativeDllName.targets b/Targets/GenerateNativeDllName.targets index 244b707b4..ce5219233 100644 --- a/Targets/GenerateNativeDllName.targets +++ b/Targets/GenerateNativeDllName.targets @@ -13,13 +13,17 @@ - namespace LibGit2Sharp.Core - { - internal static class NativeDllName - { - public const string Name = "$(libgit2_filename)"%3b - } - } +namespace LibGit2Sharp.Core +{ + internal static class NativeDllName + { +#if __IOS__ + public const string Name = "__Internal"%3b +#else + public const string Name = "$(libgit2_filename)"%3b +#endif + } +} From e0912a9aa194979c3b056fafc9d7255f3d1ae53b Mon Sep 17 00:00:00 2001 From: Ben Askren Date: Thu, 8 Dec 2022 11:01:58 -0500 Subject: [PATCH 02/12] FIX : Won't archive --- LibGit2Sharp/GlobalSettings.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/LibGit2Sharp/GlobalSettings.cs b/LibGit2Sharp/GlobalSettings.cs index f8db7401a..5d922577d 100644 --- a/LibGit2Sharp/GlobalSettings.cs +++ b/LibGit2Sharp/GlobalSettings.cs @@ -44,6 +44,13 @@ static GlobalSettings() private static string GetExecutingAssemblyDirectory() { +#if NET6_0_OR_GREATER || __MOBILE__ + System.Diagnostics.Debug.WriteLine("GlobalSettings.GetExecutingAssemblyDirectory : ENTER"); + + var managedPath = Assembly.GetExecutingAssembly().Location; + managedPath = Path.GetDirectoryName(managedPath); + return managedPath; +#else // Assembly.CodeBase is not actually a correctly formatted // URI. It's merely prefixed with `file:///` and has its // backslashes flipped. This is superior to EscapedCodeBase, @@ -65,6 +72,7 @@ private static string GetExecutingAssemblyDirectory() managedPath = Path.GetDirectoryName(managedPath); return managedPath; +#endif } /// From a95b7089e439fd4c35de38a3b85a56d409307390 Mon Sep 17 00:00:00 2001 From: Ben Askren Date: Tue, 13 Dec 2022 15:53:33 -0500 Subject: [PATCH 03/12] FIX (iOS) : LibGit2 callbacks fail because mono does not support instance methods as C delegates (but does support static methods as C delegates) --- LibGit2Sharp/CheckoutCallbacks.cs | 28 ++++- LibGit2Sharp/Commands/Fetch.cs | 5 +- LibGit2Sharp/Network.cs | 10 +- LibGit2Sharp/RemoteCallbacks.cs | 153 +++++++++++++++++++++++++++- LibGit2Sharp/Repository.cs | 8 +- LibGit2Sharp/SubmoduleCollection.cs | 5 +- 6 files changed, 192 insertions(+), 17 deletions(-) diff --git a/LibGit2Sharp/CheckoutCallbacks.cs b/LibGit2Sharp/CheckoutCallbacks.cs index dc03846bf..aaeaa6ee7 100644 --- a/LibGit2Sharp/CheckoutCallbacks.cs +++ b/LibGit2Sharp/CheckoutCallbacks.cs @@ -1,6 +1,9 @@ using System; using LibGit2Sharp.Core; using LibGit2Sharp.Handlers; +#if __IOS__ +using ObjCRuntime; +#endif namespace LibGit2Sharp { @@ -10,6 +13,23 @@ namespace LibGit2Sharp /// internal class CheckoutCallbacks { + #region Static Implementation + static CheckoutCallbacks Current; + +#if __IOS__ + [MonoPInvokeCallback(typeof(progress_cb))] +#endif + internal static void OnStaticCheckoutProgress(IntPtr str, UIntPtr completedSteps, UIntPtr totalSteps, IntPtr payload) + => Current?.OnGitCheckoutProgress(str, completedSteps, totalSteps, payload); + +#if __IOS__ + [MonoPInvokeCallback(typeof(checkout_notify_cb))] +#endif + internal static int OnStaticCheckoutNotify(CheckoutNotifyFlags why, IntPtr pathPtr, IntPtr baselinePtr, IntPtr targetPtr, IntPtr workdirPtr, IntPtr payloadPtr) + => Current?.OnGitCheckoutNotify(why, pathPtr, baselinePtr, targetPtr, workdirPtr, payloadPtr) ?? 0; + #endregion + + /// /// The managed delegate (e.g. from library consumer) to be called in response to the checkout progress callback. /// @@ -40,7 +60,8 @@ public progress_cb CheckoutProgressCallback { if (this.onCheckoutProgress != null) { - return this.OnGitCheckoutProgress; + //return this.OnGitCheckoutProgress; + return OnStaticCheckoutProgress; } return null; @@ -56,7 +77,8 @@ public checkout_notify_cb CheckoutNotifyCallback { if (this.onCheckoutNotify != null) { - return this.OnGitCheckoutNotify; + //return this.OnGitCheckoutNotify; + return OnStaticCheckoutNotify; } return null; @@ -71,7 +93,7 @@ public checkout_notify_cb CheckoutNotifyCallback /// The delegate with signature matching the expected native callback. internal static CheckoutCallbacks From(CheckoutProgressHandler onCheckoutProgress, CheckoutNotifyHandler onCheckoutNotify) { - return new CheckoutCallbacks(onCheckoutProgress, onCheckoutNotify); + return Current = new CheckoutCallbacks(onCheckoutProgress, onCheckoutNotify); } /// diff --git a/LibGit2Sharp/Commands/Fetch.cs b/LibGit2Sharp/Commands/Fetch.cs index d61fca5a5..a18b02543 100644 --- a/LibGit2Sharp/Commands/Fetch.cs +++ b/LibGit2Sharp/Commands/Fetch.cs @@ -41,8 +41,9 @@ public static void Fetch(Repository repository, string remote, IEnumerable ListReferencesInternal(string url, CredentialsHan if (credentialsProvider != null) { - var callbacks = new RemoteCallbacks(credentialsProvider); - gitCallbacks = callbacks.GenerateCallbacks(); + //var callbacks = new RemoteCallbacks(credentialsProvider); + //gitCallbacks = callbacks.GenerateCallbacks(); + gitCallbacks = RemoteCallbacks.GenerateCallbacks(credentialsProvider); } Proxy.git_remote_connect(remoteHandle, GitDirection.Fetch, ref gitCallbacks, ref proxyOptions); @@ -366,8 +367,9 @@ public virtual void Push(Remote remote, IEnumerable pushRefSpecs, PushOp // Load the remote. using (RemoteHandle remoteHandle = Proxy.git_remote_lookup(repository.Handle, remote.Name, true)) { - var callbacks = new RemoteCallbacks(pushOptions); - GitRemoteCallbacks gitCallbacks = callbacks.GenerateCallbacks(); + //var callbacks = new RemoteCallbacks(pushOptions); + //GitRemoteCallbacks gitCallbacks = callbacks.GenerateCallbacks(); + var gitCallbacks = RemoteCallbacks.GenerateCallbacks(pushOptions); Proxy.git_remote_push(remoteHandle, pushRefSpecs, diff --git a/LibGit2Sharp/RemoteCallbacks.cs b/LibGit2Sharp/RemoteCallbacks.cs index ce5dccf81..7263a7b17 100644 --- a/LibGit2Sharp/RemoteCallbacks.cs +++ b/LibGit2Sharp/RemoteCallbacks.cs @@ -1,6 +1,9 @@ using System; using LibGit2Sharp.Core; using LibGit2Sharp.Handlers; +#if __IOS__ +using ObjCRuntime; +#endif namespace LibGit2Sharp { @@ -12,12 +15,109 @@ namespace LibGit2Sharp /// internal class RemoteCallbacks { - internal RemoteCallbacks(CredentialsHandler credentialsProvider) + #region Static Fetch Callbacks + static RemoteCallbacks CurrentFetchCallback; + +#if __IOS__ + [MonoPInvokeCallback(typeof(NativeMethods.remote_progress_callback))] +#endif + internal static int StaticFetchProgressHandler(IntPtr str, int len, IntPtr data) + => CurrentFetchCallback?.GitProgressHandler(str, len, data) ?? 0; + +#if __IOS__ + [MonoPInvokeCallback(typeof(NativeMethods.git_transfer_progress_callback))] +#endif + internal static int StaticFetchDownloadTransferProgressHandler(ref GitTransferProgress progress, IntPtr payload) + => CurrentFetchCallback?.GitDownloadTransferProgressHandler(ref progress, payload) ?? 0; + +#if __IOS__ + [MonoPInvokeCallback(typeof(NativeMethods.remote_update_tips_callback))] +#endif + internal static int StaticFetchUpdateTipsHandler(IntPtr str, ref GitOid oldId, ref GitOid newId, IntPtr data) + => CurrentFetchCallback?.GitUpdateTipsHandler(str, ref oldId, ref newId, data) ?? 0; + +#if __IOS__ + [MonoPInvokeCallback(typeof(NativeMethods.git_cred_acquire_cb))] +#endif + internal static int StaticFetchCredentialHandler(out IntPtr ptr, IntPtr cUrl, IntPtr usernameFromUrl, GitCredentialType credTypes, IntPtr payload) + { + ptr = IntPtr.Zero; + return CurrentFetchCallback?.GitCredentialHandler(out ptr, cUrl, usernameFromUrl, credTypes, payload) ?? 0; + } + +#if __IOS__ + [MonoPInvokeCallback(typeof(NativeMethods.git_transport_certificate_check_cb))] +#endif + internal static unsafe int StaticFetchCertificateCheck(git_certificate* certPtr, int valid, IntPtr cHostname, IntPtr payload) + => CurrentFetchCallback?.GitCertificateCheck(certPtr, valid, cHostname, payload) ?? 0; + #endregion + + + #region Static Push Callbacks + static RemoteCallbacks CurrentPushCallback; +#if __IOS__ + [MonoPInvokeCallback(typeof(NativeMethods.git_push_transfer_progress))] +#endif + internal static int StaticPushTransferProgressHandler(uint current, uint total, UIntPtr bytes, IntPtr payload) + => CurrentPushCallback?.GitPushTransferProgressHandler(current, total, bytes, payload) ?? 0; + +#if __IOS__ + [MonoPInvokeCallback(typeof(NativeMethods.git_packbuilder_progress))] +#endif + internal static int StaticPushPackbuilderProgressHandler(int stage, uint current, uint total, IntPtr payload) + => CurrentPushCallback?.GitPackbuilderProgressHandler(stage, current, total, payload) ?? 0; + +#if __IOS__ + [MonoPInvokeCallback(typeof(NativeMethods.git_cred_acquire_cb))] +#endif + internal static int StaticPushCredentialHandler(out IntPtr ptr, IntPtr cUrl, IntPtr usernameFromUrl, GitCredentialType credTypes, IntPtr payload) + { + ptr = IntPtr.Zero; + return CurrentPushCallback?.GitCredentialHandler(out ptr, cUrl, usernameFromUrl, credTypes, payload) ?? 0; + } + +#if __IOS__ + [MonoPInvokeCallback(typeof(NativeMethods.git_transport_certificate_check_cb))] +#endif + internal static unsafe int StaticPushCertificateCheck(git_certificate* certPtr, int valid, IntPtr cHostname, IntPtr payload) + => CurrentPushCallback?.GitCertificateCheck(certPtr, valid, cHostname, payload) ?? 0; + +#if __IOS__ + [MonoPInvokeCallback(typeof(NativeMethods.push_update_reference_callback))] +#endif + internal static int StaticPushUpdateReference(IntPtr str, IntPtr status, IntPtr data) + => CurrentPushCallback?.GitPushUpdateReference(str, status, data) ?? 0; + +#if __IOS__ + [MonoPInvokeCallback(typeof(NativeMethods.push_negotiation_callback))] +#endif + internal static int StaticPushNegotiationHandler(IntPtr updates, UIntPtr len, IntPtr payload) + => CurrentPushCallback?.GitPushNegotiationHandler(updates, len, payload) ?? 0; + #endregion + + + #region Static CredentialsHandler Callbacks + static RemoteCallbacks CurrentCredientialsCallback; + +#if __IOS__ + [MonoPInvokeCallback(typeof(NativeMethods.git_cred_acquire_cb))] +#endif + internal static int StaticCredentialHandler(out IntPtr ptr, IntPtr cUrl, IntPtr usernameFromUrl, GitCredentialType credTypes, IntPtr payload) + { + ptr = IntPtr.Zero; + return CurrentPushCallback?.GitCredentialHandler(out ptr, cUrl, usernameFromUrl, credTypes, payload) ?? 0; + } + + #endregion + + + #region Constructors + private RemoteCallbacks(CredentialsHandler credentialsProvider) { CredentialsProvider = credentialsProvider; } - internal RemoteCallbacks(PushOptions pushOptions) + private RemoteCallbacks(PushOptions pushOptions) { if (pushOptions == null) { @@ -32,7 +132,7 @@ internal RemoteCallbacks(PushOptions pushOptions) PrePushCallback = pushOptions.OnNegotiationCompletedBeforePush; } - internal RemoteCallbacks(FetchOptionsBase fetchOptions) + private RemoteCallbacks(FetchOptionsBase fetchOptions) { if (fetchOptions == null) { @@ -45,6 +145,8 @@ internal RemoteCallbacks(FetchOptionsBase fetchOptions) CredentialsProvider = fetchOptions.CredentialsProvider; CertificateCheck = fetchOptions.CertificateCheck; } + #endregion + #region Delegates @@ -97,6 +199,51 @@ internal RemoteCallbacks(FetchOptionsBase fetchOptions) /// private readonly CertificateCheckHandler CertificateCheck; + + internal static unsafe GitRemoteCallbacks GenerateCallbacks(CredentialsHandler credentialsProvider) + { + var callbacks = new GitRemoteCallbacks { version = 1 }; + CurrentCredientialsCallback = new RemoteCallbacks(credentialsProvider); + callbacks.acquire_credentials = StaticCredentialHandler; + return callbacks; + } + + internal static unsafe GitRemoteCallbacks GenerateCallbacks(PushOptions pushOptions) + { + var callbacks = new GitRemoteCallbacks { version = 1 }; + CurrentPushCallback = new RemoteCallbacks(pushOptions); + if (CurrentPushCallback?.PushTransferProgress != null) + callbacks.push_transfer_progress = StaticPushTransferProgressHandler; + if (CurrentPushCallback?.PackBuilderProgress != null) + callbacks.pack_progress = StaticPushPackbuilderProgressHandler; + if (CurrentPushCallback?.CredentialsProvider != null) + callbacks.acquire_credentials = StaticPushCredentialHandler; + if (CurrentPushCallback?.CertificateCheck != null) + callbacks.certificate_check = StaticPushCertificateCheck; + if (CurrentPushCallback?.PushStatusError != null) + callbacks.push_update_reference = StaticPushUpdateReference; + if (CurrentPushCallback?.PrePushCallback != null) + callbacks.push_negotiation = StaticPushNegotiationHandler; + return callbacks; + } + + internal static unsafe GitRemoteCallbacks GenerateCallbacks(FetchOptionsBase fetchOptions) + { + var callbacks = new GitRemoteCallbacks { version = 1 }; + CurrentFetchCallback = new RemoteCallbacks(fetchOptions); + if (CurrentFetchCallback?.Progress != null) + callbacks.progress = StaticFetchProgressHandler; + if (CurrentFetchCallback?.DownloadTransferProgress != null) + callbacks.download_progress = StaticFetchDownloadTransferProgressHandler; + if (CurrentFetchCallback?.UpdateTips != null) + callbacks.update_tips = StaticFetchUpdateTipsHandler; + if (CurrentFetchCallback?.CredentialsProvider != null) + callbacks.acquire_credentials = StaticFetchCredentialHandler; + if (CurrentFetchCallback?.CertificateCheck != null) + callbacks.certificate_check = StaticFetchCertificateCheck; + return callbacks; + } + internal unsafe GitRemoteCallbacks GenerateCallbacks() { var callbacks = new GitRemoteCallbacks { version = 1 }; diff --git a/LibGit2Sharp/Repository.cs b/LibGit2Sharp/Repository.cs index 41aaecfbf..75fabf8cd 100644 --- a/LibGit2Sharp/Repository.cs +++ b/LibGit2Sharp/Repository.cs @@ -682,8 +682,9 @@ public static IEnumerable ListRemoteReferences(string url, Credential if (credentialsProvider != null) { - var callbacks = new RemoteCallbacks(credentialsProvider); - gitCallbacks = callbacks.GenerateCallbacks(); + //var callbacks = new RemoteCallbacks(credentialsProvider); + //gitCallbacks = callbacks.GenerateCallbacks(); + gitCallbacks = RemoteCallbacks.GenerateCallbacks(credentialsProvider); } Proxy.git_remote_connect(remoteHandle, GitDirection.Fetch, ref gitCallbacks, ref proxyOptions); @@ -769,7 +770,8 @@ public static string Clone(string sourceUrl, string workdirPath, var gitFetchOptions = fetchOptionsWrapper.Options; gitFetchOptions.ProxyOptions = new GitProxyOptions { Version = 1 }; - gitFetchOptions.RemoteCallbacks = new RemoteCallbacks(options).GenerateCallbacks(); + //gitFetchOptions.RemoteCallbacks = new RemoteCallbacks(options).GenerateCallbacks(); + gitFetchOptions.RemoteCallbacks = RemoteCallbacks.GenerateCallbacks(options); if (options.FetchOptions != null && options.FetchOptions.CustomHeaders != null) { gitFetchOptions.CustomHeaders = diff --git a/LibGit2Sharp/SubmoduleCollection.cs b/LibGit2Sharp/SubmoduleCollection.cs index fc508107a..96bcf0106 100644 --- a/LibGit2Sharp/SubmoduleCollection.cs +++ b/LibGit2Sharp/SubmoduleCollection.cs @@ -97,8 +97,9 @@ public virtual void Update(string name, SubmoduleUpdateOptions options) { var gitCheckoutOptions = checkoutOptionsWrapper.Options; - var remoteCallbacks = new RemoteCallbacks(options); - var gitRemoteCallbacks = remoteCallbacks.GenerateCallbacks(); + //var remoteCallbacks = new RemoteCallbacks(options); + //var gitRemoteCallbacks = remoteCallbacks.GenerateCallbacks(); + var gitRemoteCallbacks = RemoteCallbacks.GenerateCallbacks(options); var gitSubmoduleUpdateOpts = new GitSubmoduleUpdateOptions { From 6c7cb1a5777f071c870903beff4cf91fd9e5ffaf Mon Sep 17 00:00:00 2001 From: Ben Askren Date: Sat, 21 Jan 2023 07:45:17 -0500 Subject: [PATCH 04/12] UPDATE : .NET7 --- LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj | 2 +- LibGit2Sharp/LibGit2Sharp.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj index 25e652522..c56b726a7 100644 --- a/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj +++ b/LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp3.1;net6.0 + net472;netcoreapp3.1;net7.0 diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index b8a90c0a9..b228a2489 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -1,7 +1,7 @@  - net6.0;net6.0-ios + net7.0;net7.0-ios true LibGit2Sharp brings all the might and speed of libgit2, a native Git implementation, to the managed world of .NET LibGit2Sharp contributors From 2f87076a694059c9981863b5b106921b2bfca4f0 Mon Sep 17 00:00:00 2001 From: Ben Askren Date: Tue, 7 Feb 2023 18:23:35 -0500 Subject: [PATCH 05/12] FEAT : Prep for NuGet --- LibGit2Sharp/Directory.Build.props | 81 ++++++++++++++++++++++++++++++ LibGit2Sharp/LibGit2Sharp.csproj | 5 +- 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 LibGit2Sharp/Directory.Build.props diff --git a/LibGit2Sharp/Directory.Build.props b/LibGit2Sharp/Directory.Build.props new file mode 100644 index 000000000..5aaf61624 --- /dev/null +++ b/LibGit2Sharp/Directory.Build.props @@ -0,0 +1,81 @@ + + + + + true + false + + + bin\$(MSBuildProjectName) + obj\$(MSBuildProjectName) + $(DefaultItemExcludes);obj/**;bin/** + + true + true + true + snupkg + + True + Ben Askren + 42nd Parallel, LLC + Convenience classes for Serilog logging + 2023, 4nd Parallel + https://github.com/baskren/P42.Serilog.QuickLog + https://github.com/baskren/P42.Serilog.QuickLog + git + Inital Public Release + LICENSE + P42.icon.png + README.md + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index b228a2489..359e886e0 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -7,13 +7,15 @@ LibGit2Sharp contributors Copyright © LibGit2Sharp contributors libgit2 git - https://github.com/libgit2/libgit2sharp/ + https://github.com/baskren/libgit2sharp.git LibGit2Sharp contributors true true embedded + square-logo.png App_Readme/LICENSE.md true @@ -31,7 +33,6 @@ - From 38034f9e949b9d1d166d3b5085a552363d6d3d55 Mon Sep 17 00:00:00 2001 From: Ben Askren Date: Tue, 7 Feb 2023 19:19:09 -0500 Subject: [PATCH 06/12] FIX : Packaging --- LibGit2Sharp/Directory.Build.props | 8 ++++---- LibGit2Sharp/LibGit2Sharp.csproj | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/LibGit2Sharp/Directory.Build.props b/LibGit2Sharp/Directory.Build.props index 5aaf61624..db1496de1 100644 --- a/LibGit2Sharp/Directory.Build.props +++ b/LibGit2Sharp/Directory.Build.props @@ -27,8 +27,8 @@ https://github.com/baskren/P42.Serilog.QuickLog git Inital Public Release - LICENSE - P42.icon.png + LICENSE.md + square-logo.png README.md @@ -38,9 +38,9 @@ - + - + diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 359e886e0..e8119bfe7 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -21,6 +21,13 @@ true + + 4 + true + + + true + From 5936acb22b10a5689cefcf085bd07de63aa8582c Mon Sep 17 00:00:00 2001 From: baskren Date: Thu, 4 May 2023 10:58:28 -0400 Subject: [PATCH 07/12] UPDATE: Nerdbank.GitVersioning 3.6.128 --- LibGit2Sharp/LibGit2Sharp.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index e8119bfe7..73a7fa50b 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -40,7 +40,7 @@ - + From 9d1f335184221fcf38341b958b526036a3f6dbff Mon Sep 17 00:00:00 2001 From: baskren Date: Fri, 7 Jul 2023 13:05:36 -0400 Subject: [PATCH 08/12] UPDATE : P42.Serilog.Quicklog --- LibGit2Sharp/CheckoutCallbacks.cs | 6 +++++- LibGit2Sharp/LibGit2Sharp.csproj | 3 ++- LibGit2Sharp/ObjectDatabase.cs | 3 ++- LibGit2Sharp/RemoteCallbacks.cs | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/LibGit2Sharp/CheckoutCallbacks.cs b/LibGit2Sharp/CheckoutCallbacks.cs index aaeaa6ee7..e2d2f9484 100644 --- a/LibGit2Sharp/CheckoutCallbacks.cs +++ b/LibGit2Sharp/CheckoutCallbacks.cs @@ -17,17 +17,21 @@ internal class CheckoutCallbacks static CheckoutCallbacks Current; #if __IOS__ +#pragma warning disable CA1416 [MonoPInvokeCallback(typeof(progress_cb))] +#pragma warning restore CA1416 #endif internal static void OnStaticCheckoutProgress(IntPtr str, UIntPtr completedSteps, UIntPtr totalSteps, IntPtr payload) => Current?.OnGitCheckoutProgress(str, completedSteps, totalSteps, payload); #if __IOS__ +#pragma warning disable CA1416 [MonoPInvokeCallback(typeof(checkout_notify_cb))] +#pragma warning restore CA1416 #endif internal static int OnStaticCheckoutNotify(CheckoutNotifyFlags why, IntPtr pathPtr, IntPtr baselinePtr, IntPtr targetPtr, IntPtr workdirPtr, IntPtr payloadPtr) => Current?.OnGitCheckoutNotify(why, pathPtr, baselinePtr, targetPtr, workdirPtr, payloadPtr) ?? 0; - #endregion +#endregion /// diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 73a7fa50b..3f654f47d 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -40,7 +40,8 @@ - + + diff --git a/LibGit2Sharp/ObjectDatabase.cs b/LibGit2Sharp/ObjectDatabase.cs index 52aceb321..b58f723d3 100644 --- a/LibGit2Sharp/ObjectDatabase.cs +++ b/LibGit2Sharp/ObjectDatabase.cs @@ -318,7 +318,8 @@ private unsafe Blob CreateBlob(Stream stream, string hintpath, long? numberOfByt catch(Exception e) { writestream.free(writestream_ptr); - throw e; + P42.Serilog.QuickLog.QLog.Error(e); + throw; } ObjectId id = Proxy.git_blob_create_fromstream_commit(writestream_ptr); diff --git a/LibGit2Sharp/RemoteCallbacks.cs b/LibGit2Sharp/RemoteCallbacks.cs index 7263a7b17..ea607bbe8 100644 --- a/LibGit2Sharp/RemoteCallbacks.cs +++ b/LibGit2Sharp/RemoteCallbacks.cs @@ -15,6 +15,9 @@ namespace LibGit2Sharp /// internal class RemoteCallbacks { + +#pragma warning disable CA1416 + #region Static Fetch Callbacks static RemoteCallbacks CurrentFetchCallback; @@ -110,6 +113,7 @@ internal static int StaticCredentialHandler(out IntPtr ptr, IntPtr cUrl, IntPtr #endregion +#pragma warning restore CA1416 #region Constructors private RemoteCallbacks(CredentialsHandler credentialsProvider) From e4f101bcc8738511a8494170fca33076d65d8c9b Mon Sep 17 00:00:00 2001 From: baskren Date: Fri, 20 Oct 2023 07:14:11 -0400 Subject: [PATCH 09/12] UPDATE : P42.Serilog.Quicklog 1.0.5 --- LibGit2Sharp/LibGit2Sharp.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 3f654f47d..b05f88698 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -41,7 +41,7 @@ - + From f3bf5331eb4e4ae9900c831e7fef8eeaec2919e7 Mon Sep 17 00:00:00 2001 From: baskren Date: Mon, 23 Oct 2023 22:15:51 -0400 Subject: [PATCH 10/12] FEAT : pulled in Qlog source --- LibGit2Sharp/LibGit2Sharp - Backup.csproj | 64 +++++++++++++++++++++++ LibGit2Sharp/LibGit2Sharp.csproj | 5 +- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 LibGit2Sharp/LibGit2Sharp - Backup.csproj diff --git a/LibGit2Sharp/LibGit2Sharp - Backup.csproj b/LibGit2Sharp/LibGit2Sharp - Backup.csproj new file mode 100644 index 000000000..383a78e26 --- /dev/null +++ b/LibGit2Sharp/LibGit2Sharp - Backup.csproj @@ -0,0 +1,64 @@ + + + + net7.0;net7.0-ios + true + LibGit2Sharp brings all the might and speed of libgit2, a native Git implementation, to the managed world of .NET + LibGit2Sharp contributors + Copyright © LibGit2Sharp contributors + libgit2 git + https://github.com/baskren/libgit2sharp.git + LibGit2Sharp contributors + true + true + embedded + + square-logo.png + App_Readme/LICENSE.md + true + + + + 4 + true + + + true + + + + + + + + + + + + + + + + + + + + + + https://github.com/libgit2/libgit2sharp/blob/$(GitCommitIdShort)/CHANGES.md#libgit2sharp-changes + + + + + + + + + + + + + diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index b05f88698..9932704cc 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -41,7 +41,10 @@ - + + + + From 28b80bc7af353cf25e0a93cdb01ab10d56dd35a6 Mon Sep 17 00:00:00 2001 From: baskren Date: Wed, 22 Nov 2023 10:35:06 -0500 Subject: [PATCH 11/12] UPDATE : .net8 build environment updates --- LibGit2Sharp/Directory.Build.props | 2 +- LibGit2Sharp/LibGit2Sharp.csproj | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/LibGit2Sharp/Directory.Build.props b/LibGit2Sharp/Directory.Build.props index db1496de1..1ea3ff9c4 100644 --- a/LibGit2Sharp/Directory.Build.props +++ b/LibGit2Sharp/Directory.Build.props @@ -45,7 +45,7 @@ - + diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 9932704cc..0daf6bd9a 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -41,10 +41,7 @@ - - - - + From 6fb19eee6fe8ab66744a00270dd1743857c6d011 Mon Sep 17 00:00:00 2001 From: baskren Date: Wed, 6 Dec 2023 15:10:10 -0500 Subject: [PATCH 12/12] UPDATE : P42.Serilog.QuickLog 1.0.8 --- LibGit2Sharp/LibGit2Sharp.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 0daf6bd9a..97f9d2309 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -41,7 +41,7 @@ - +