Represents a specific version of the content of a file tracked by git.
상속: AbstractObject
예제 #1
0
파일: Examples.cs 프로젝트: dev218/GitSharp
        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;
        }
예제 #2
0
        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;
        }