Git.Core.Object.ParseType C# (CSharp) Method

ParseType() protected static method

protected static ParseType ( byte input, int &pos, Type &type ) : bool
input byte
pos int
type System.Type
return bool
        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;
        }