8000 Draft: Add new exception types for different GitErrorCodes · Pull Request #22 · mendix/libgit2sharp · GitHub
[go: up one dir, main page]

Skip to content

Draft: Add new exception types for different GitErrorCodes #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added Assertion to CannotFetchWithForbiddenCustomHeaders that the Git…
…ErrorCategory is invalid when the exception is thrown
  • Loading branch information
MarcellvanRooyen authored and Alexander Ovchinnikov committed Apr 7, 2023
commit e239dc7cef9fdc905c69e97c98a5a61882ffcd3e
4 changes: 3 additions & 1 deletion LibGit2Sharp.Tests/FetchFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using LibGit2Sharp.Core;
using LibGit2Sharp.Tests.TestHelpers;
using Xunit;

Expand Down Expand Up @@ -251,7 +252,8 @@ public void CannotFetchWithForbiddenCustomHeaders()
var options = new FetchOptions { CustomHeaders = new String[] { knownHeader } };
using (var repo = new Repository(clonedRepoPath))
{
Assert.Throws<LibGit2SharpException>(() => Commands.Fetch(repo, "origin", new string[0], options, null, new ProxyOptions()));
var ex = Assert.Throws<LibGit2SharpException>(() => Commands.Fetch(repo, "origin", new string[0], options, null, new ProxyOptions()));
Assert.Equal(GitErrorCategory.Invalid, ex.Category);
}
}

Expand Down
0