Skip to content

Commit c7c12e7

Browse files
committed
Enforce symlink creation and parsing test coverage
1 parent af11289 commit c7c12e7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

LibGit2Sharp.Tests/TreeFixture.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,28 @@ public void CanRetrieveTreeEntryPath()
200200
Assert.NotSame(anotherInstance, anInstance);
201201
}
202202
}
203+
204+
[Fact]
205+
public void CanParseSymlinkTreeEntries()
206+
{
207+
var path = CloneBareTestRepo();
208+
209+
using (var repo = new Repository(path))
210+
{
211+
Blob linkContent = OdbHelper.CreateBlob(repo, "1/branch_file.txt");
212+
213+
var td = TreeDefinition.From(repo.Head.Tip)
214+
.Add("A symlink", linkContent, Mode.SymbolicLink);
215+
216+
Tree t = repo.ObjectDatabase.CreateTree(td);
217+
218+
var te = t["A symlink"];
219+
220+
Assert.NotNull(te);
221+
222+
Assert.Equal(Mode.SymbolicLink, te.Mode);
223+
Assert.Equal(linkContent, te.Target);
224+
}
225+
}
203226
}
204227
}

0 commit comments

Comments
 (0)