コード例 #1
0
ファイル: Tree.cs プロジェクト: zvirja/libgit2sharp
        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
ファイル: TagAnnotation.cs プロジェクト: dahlbyk/libgit2sharp
        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
ファイル: GitObject.cs プロジェクト: rprouse/libgit2sharp
 /// <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);
 }