Files
git-tfs/GitTfs/Core/TfsTreeEntry.cs
T
2011-01-28 15:35:26 -05:00

27 lines
706 B
C#

using System.IO;
using Sep.Git.Tfs.Core.TfsInterop;
using Sep.Git.Tfs.Util;
namespace Sep.Git.Tfs.Core
{
public class TfsTreeEntry : ITreeEntry
{
private readonly string _pathInGitRepo;
private readonly IItem _item;
public TfsTreeEntry(string pathInGitRepo, IItem item)
{
_pathInGitRepo = pathInGitRepo;
_item = item;
}
public IItem Item { get { return _item; } }
public string FullName { get { return _pathInGitRepo; } }
public Stream OpenRead()
{
var tempfile = new TemporaryFile();
_item.DownloadFile(tempfile);
return tempfile.ToStream();
}
}
}