internal Tree(Repository repo, ObjectId id, string path) : base(repo, id) { this.path = path ?? ""; lazyCount = GitObjectLazyGroup.Singleton(repo, id, Proxy.git_tree_entrycount); }
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); }
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); }
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); }
/// <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); }