Files
git-tfs/GitTfs/Core/GitTreeEntry.cs
T
Sean M. Collins f72048b964 Replace GitSharp in GitCommit and GitTreeEntry
The paths returned from LibGit2Sharp are platform
dependent, while the paths returned from TFS are
URIs that use a forward slash.
2012-05-21 16:05:02 -04:00

33 lines
714 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.Type == GitObjectType.Blob)
{
return ((Blob)_entry.Target).ContentStream;
}
else
throw new InvalidOperationException("Invalid object type");
}
}
}