Represents a specific version of the content of a file tracked by git.
Inheritance: AbstractObject
Example #1
0
        public void Blob()
        {
            //A Leaf is a Blob and inherits from it a method to retrieve the data as a UTF8 encoded string:
            string string_data = new Blob(repo, "49322bb17d3acc9146f98c97d078513228bbf3c0").Data;

            // Blob also let's you access the raw data as byte array
            byte[] byte_data = new Blob(repo, "49322bb17d3acc9146f98c97d078513228bbf3c0").RawData;
        }
        public GitObject CreateFromContent(GitObjectStream content)
        {
            string type = ReadHeading(content);

            GitObject obj;

            if (type == "commit")
                obj = new Commit();
            else if (type == "tree")
                obj = new Tree();
            else if (type == "blob")
                obj = new Blob();
            else
                throw new NotImplementedException("Support for file type is not implemented.");

            content.Rewind();

            obj.Load(content);

            return obj;
        }