8000 Propagate libgit2 error messages upward · dotjosh/libgit2sharp@62208a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 62208a3

Browse files
committed
Propagate libgit2 error messages upward
1 parent 6cb5f85 commit 62208a3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

LibGit2Sharp/Core/Ensure.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static void Success(int result, bool allowPositiveResult = false)
6060
return;
6161
}
6262

63-
string errorMessage = "An error occured"; // NativeMethods.git_lasterror().MarshallAsString();
63+
string errorMessage = NativeMethods.git_lasterror().MarshallAsString();
6464

6565
throw new ApplicationException(
6666
String.Format(CultureInfo.InvariantCulture, "An error was raised by libgit2. Error code = {0} ({1}).{2}{3}", Enum.GetName(typeof(GitErrorCode), result), result, Environment.NewLine, errorMessage));

LibGit2Sharp/Core/GitErrorCode.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ internal enum GitErrorCode
144144
/// invalid arguments to function
145145
/// </summary>
146146
GIT_EINVALIDARGS = -27,
147-
147+
148148
/// <summary>
149149
/// The specified o 7B1B bject has its data corrupted
150150
/// </summary>
@@ -154,5 +154,10 @@ internal enum GitErrorCode
154154
/// The given short oid is ambiguous
155155
/// </summary>
156156
GIT_EAMBIGUOUSOIDPREFIX = -29,
157-
}
157+
158+
/// <summary>
159+
/// Skip and passthrough the given ODB backend
160+
/// </summary>
161+
GIT_EPASSTHROUGH = -30,
162+
}
158163
}

0 commit comments

Comments
 (0)
0