Skip to content

Commit

Permalink
Issue-1471 Fix memory leak in test
Browse files Browse the repository at this point in the history
  • Loading branch information
mminns committed Nov 6, 2018
1 parent 016fc95 commit 9d17daa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions LibGit2Sharp.Tests/WorktreeFixture.cs
Expand Up @@ -167,9 +167,12 @@ public void CanPruneDeletedWorktree()
var worktreeUnlocked = repo.Worktrees["i-do-numbers"];
Assert.Equal("i-do-numbers", worktreeUnlocked.Name);
Assert.False(worktreeUnlocked.IsLocked);
var info = worktreeUnlocked.WorktreeRepository.Info;
using (var wtRepo = worktreeUnlocked.WorktreeRepository)
{
var info = wtRepo.Info;

Directory.Delete(info.WorkingDirectory, true);
Directory.Delete(info.WorkingDirectory, true);
}

Assert.True(repo.Worktrees.Prune(worktreeUnlocked));

Expand Down

0 comments on commit 9d17daa

Please sign in to comment.