8000 Enforce Network.ListReferences() test coverage · apfunk/libgit2sharp@1ca809d · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ca809d

Browse files
committed
Enforce Network.ListReferences() test coverage
This puts under the light that DirectReferences may point to GitObjects unknown from the local repository.
1 parent 9bfe5e4 commit 1ca809d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

LibGit2Sharp.Tests/NetworkFixture.cs

Lines changed: 8 additions & 1 deletion
Original file 9BC3 line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ public void CanListRemoteReferences(string url)
2222
using (var repo = new Repository(repoPath))
2323
{
2424
Remote remote = repo.Network.Remotes.Add(remoteName, url);
25-
IEnumerable<DirectReference> references = repo.Network.ListReferences(remote);
25+
IList<DirectReference> references = repo.Network.ListReferences(remote).ToList();
26+
27+
foreach (var directReference in references)
28+
{
29+
// None of those references point to an existing
30+
// object in this brand new repository
31+
Assert.Null(directReference.Target);
32+
}
2633

2734
List<Tuple<string, string>> actualRefs = references.
2835
Select(directRef => new Tuple<string, string>(directRef.CanonicalName, directRef.TargetIdentifier)).ToList();

0 commit comments

Comments
 (0)
0