Пример #1
0
        internal Tree(Repository repo, ObjectId id, string path)
            : base(repo, id)
        {
            this.path = path ?? "";

            lazyCount = GitObjectLazyGroup.Singleton(repo, id, Proxy.git_tree_entrycount);
        }
Пример #2
0
        internal TagAnnotation(Repository repo, ObjectId id)
            : base(repo, id)
        {
            lazyName   = GitObjectLazyGroup.Singleton(repo, id, Proxy.git_tag_name);
            lazyTarget = GitObjectLazyGroup.Singleton(repo, id,
                                                      obj => BuildFrom(repo, Proxy.git_tag_target_oid(obj), Proxy.git_tag_target_type(obj), null));

            group       = new GitObjectLazyGroup(repo, id);
            lazyTagger  = group.AddLazy(Proxy.git_tag_tagger);
            lazyMessage = group.AddLazy(Proxy.git_tag_message);
        }
Пример #3
0
        internal TagAnnotation(Repository repo, ObjectId id)
            : base(repo, id)
        {
            lazyName = GitObjectLazyGroup.Singleton(repo, id, Proxy.git_tag_name);
            lazyTarget = GitObjectLazyGroup.Singleton(repo, id,
                obj => BuildFrom(repo, Proxy.git_tag_target_oid(obj), Proxy.git_tag_target_type(obj), null));

            group = new GitObjectLazyGroup(repo, id);
            lazyTagger = group.AddLazy(Proxy.git_tag_tagger);
            lazyMessage = group.AddLazy(Proxy.git_tag_message);
        }
Пример #4
0
        internal Commit(Repository repo, ObjectId id)
            : base(repo, id)
        {
            lazyTree = GitObjectLazyGroup.Singleton(this.repo, id, obj => new Tree(this.repo, Proxy.git_commit_tree_oid(obj), null));

            group         = new GitObjectLazyGroup(this.repo, id);
            lazyAuthor    = group.AddLazy(Proxy.git_commit_author);
            lazyCommitter = group.AddLazy(Proxy.git_commit_committer);
            lazyMessage   = group.AddLazy(Proxy.git_commit_message);
            lazyEncoding  = group.AddLazy(RetrieveEncodingOf);

            lazyShortMessage = new Lazy <string>(ExtractShortMessage);
            lazyNotes        = new Lazy <IEnumerable <Note> >(() => RetrieveNotesOfCommit(id).ToList());

            parents = new ParentsCollection(repo, id);
        }
Пример #5
0
 internal Blob(Repository repo, ObjectId id)
     : base(repo, id)
 {
     lazySize     = GitObjectLazyGroup.Singleton(repo, id, Proxy.git_blob_rawsize);
     lazyIsBinary = GitObjectLazyGroup.Singleton(repo, id, Proxy.git_blob_is_binary);
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GitObject"/> class.
 /// </summary>
 /// <param name="repo">The <see cref="Repository"/> containing the object.</param>
 /// <param name="id">The <see cref="ObjectId"/> it should be identified by.</param>
 protected GitObject(Repository repo, ObjectId id)
 {
     this.repo     = repo;
     Id            = id;
     lazyIsMissing = GitObjectLazyGroup.Singleton(repo, id, handle => handle == null, throwIfMissing: false);
 }