private IDictionary<string, IRef> FindPackedRefs()
{
var refs = new Dictionary<string, IRef>();
try
{
var file = File.OpenRead(Path.Combine(iFolderGit.FullName, "packed-refs"));
using (var reader = new StreamReader(file))
{
while (true)
{
string line = reader.ReadLine();
if (line == null)
{
return (refs);
}
if (line.Length > 0)
{
if (Char.IsLetterOrDigit(line, 0))
{
string[] parts = line.Split(new char[] { ' ' });
if (parts.Length == 2)
{
if (parts[0].Length == 40)
{
if (parts[1].StartsWith("refs/tags/"))
{
string name = parts[1].Substring(10);
refs.Add(name, new RefPacked(this, name, parts[0]));
}
/*
else if (parts[1].StartsWith("refs/remotes/"))
{
iBranches.Add(new BranchRefPacked(this, parts[1].Substring(13), parts[0]));
}
*/
}
}
}
}
}
}
}
catch
{
}
return (refs);
}