Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions LibGit2Sharp.Tests/RepositoryFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ public void IsValidWithValidPath()
Assert.True(Repository.IsValid(repoPath));
}

//[Fact]
//public void IsValidWithInvalidGitConfig()
//{
// string repoPath = InitNewRepository();
// File.AppendAllLines(Path.Combine(repoPath, "config"), new[] { @"[diff ""mytool""] command = C:\path\to\mytool\mytool.exe" });
// var ex = Assert.Throws<LibGit2SharpException>(() => Repository.IsValid(repoPath));
// Assert.Equal(@"invalid escape at path\to\mytool\mytool.exe", ex.Message);
//}

[Fact]
public void CanCreateStandardRepo()
{
Expand Down
5 changes: 5 additions & 0 deletions LibGit2Sharp/Core/Proxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2575,6 +2575,11 @@ public static unsafe void git_repository_open_ext(string path, RepositoryOpenFla
res = NativeMethods.git_repository_open_ext(out repo, path, flags, ceilingDirs);
NativeMethods.git_repository_free(repo);

//if (res == (int)GitErrorCode.Ok)
//{
// NativeMethods.git_repository_free(repo);
//}

if (res == (int)GitErrorCode.NotFound)
{
throw new RepositoryNotFoundException("Path '{0}' doesn't point at a valid Git repository or workdir.",
Expand Down