protected static bool ParseType(byte[] input, ref int pos, out Type type)
{
string decodedType;
type = Type.Blob; // we need a default
if (pos != 0)
return false;
if (!ParseNoSpaceString (input, ref pos, out decodedType))
return false;
pos ++;
switch (decodedType) {
case "blob":
type = Type.Blob;
return true;
case "tree":
type = Type.Tree;
return true;
case "commit":
type = Type.Commit;
return true;
break;
case "tag":
type = Type.Tag;
return true;
break;
}
return true;
}