diff options
author | nulltoken <emeric.fermas@gmail.com> | 2013-11-03 22:57:15 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2013-11-03 22:57:15 +0400 |
commit | c7c12e719d5487351d2fd07f3c1572649dddd6c5 (patch) | |
tree | 1dd579b26f2abe123f0f1c7d4fef6b96d4c3ddbd /LibGit2Sharp.Tests | |
parent | af112891809fddb14705cb751f5217ee6b9cd990 (diff) |
Enforce symlink creation and parsing test coverage
Diffstat (limited to 'LibGit2Sharp.Tests')
-rw-r--r-- | LibGit2Sharp.Tests/TreeFixture.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/LibGit2Sharp.Tests/TreeFixture.cs b/LibGit2Sharp.Tests/TreeFixture.cs index a3241965..679345f5 100644 --- a/LibGit2Sharp.Tests/TreeFixture.cs +++ b/LibGit2Sharp.Tests/TreeFixture.cs @@ -200,5 +200,28 @@ namespace LibGit2Sharp.Tests Assert.NotSame(anotherInstance, anInstance); } } + + [Fact] + public void CanParseSymlinkTreeEntries() + { + var path = CloneBareTestRepo(); + + using (var repo = new Repository(path)) + { + Blob linkContent = OdbHelper.CreateBlob(repo, "1/branch_file.txt"); + + var td = TreeDefinition.From(repo.Head.Tip) + .Add("A symlink", linkContent, Mode.SymbolicLink); + + Tree t = repo.ObjectDatabase.CreateTree(td); + + var te = t["A symlink"]; + + Assert.NotNull(te); + + Assert.Equal(Mode.SymbolicLink, te.Mode); + Assert.Equal(linkContent, te.Target); + } + } } } |