From 1436b6893f906fa4e04532d5d35444a895b8ee16 Mon Sep 17 00:00:00 2001 From: Rob E Date: Sat, 19 Jul 2025 15:57:44 +1000 Subject: [PATCH] Do not use `LibGit2SharpException` overload for unknown message --- LibGit2Sharp/Core/Ensure.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibGit2Sharp/Core/Ensure.cs b/LibGit2Sharp/Core/Ensure.cs index cd681e4ba..5a0f89147 100644 --- a/LibGit2Sharp/Core/Ensure.cs +++ b/LibGit2Sharp/Core/Ensure.cs @@ -148,7 +148,7 @@ private static unsafe void HandleError(int result) Func exceptionBuilder; if (!GitErrorsToLibGit2SharpExceptions.TryGetValue((GitErrorCode)result, out exceptionBuilder)) { - exceptionBuilder = (m, c) => new LibGit2SharpException(m, c); + exceptionBuilder = (m, c) => new LibGit2SharpException($"{m}{(c == GitErrorCategory.Unknown ? string.Empty: $"\nGitErrorCode{c}")}"); } throw exceptionBuilder(errorMessage, errorCategory);