Files
git-tfs/GitTfs/Core/GitTreeEntry.cs
T
Matt Burke b3c83c8f55 Don't convert line endings in commit messages.
* Update to include libgit2/libgit2sharp#611
* Revert 4eaabce1ae
* Revise release notes for #534
2014-02-12 06:46:49 -05:00

33 lines
731 B
C#

using System;
using System.IO;
using LibGit2Sharp;
namespace Sep.Git.Tfs.Core
{
public class GitTreeEntry : ITreeEntry
{
private readonly TreeEntry _entry;
public GitTreeEntry(TreeEntry entry)
{
_entry = entry;
}
public TreeEntry Entry { get { return _entry; } }
public string FullName
{
get { return _entry.Path; }
}
public Stream OpenRead()
{
if (_entry.TargetType == TreeEntryTargetType.Blob)
{
return ((Blob)_entry.Target).GetContentStream();
}
else
throw new InvalidOperationException("Invalid object type");
}
}
}