internal GitDirectoryTreeEntry(GitTree tree, string name, GitTreeElementType mask, GitId item) : base(tree, name, item) { ElementType = mask; }
internal static async ValueTask <GitObject> FromBucketAsync(GitRepository repository, GitObjectBucket rdr, GitId id, GitObjectType type = GitObjectType.None) { GitObjectType tp; if (type == GitObjectType.None) { tp = await rdr.ReadTypeAsync().ConfigureAwait(false); } else { tp = type; } switch (tp) { case GitObjectType.Commit: return(new GitCommit(repository, rdr, id)); case GitObjectType.Tree: return(new GitTree(repository, rdr, id)); case GitObjectType.Blob: return(new GitBlob(repository, rdr, id)); case GitObjectType.Tag: return(new GitTagObject(repository, rdr, id)); default: throw new ArgumentOutOfRangeException(nameof(type)); } }
internal GitTreeEntry(GitTree tree, string name, GitId id) { InTree = tree ?? throw new ArgumentNullException(nameof(tree)); Name = name ?? throw new ArgumentNullException(nameof(name)); Id = id ?? throw new ArgumentNullException(nameof(id)); }
private protected GitObject(GitRepository repository, GitId id) { Repository = repository ?? throw new ArgumentNullException(nameof(repository)); Id = id ?? throw new ArgumentNullException(nameof(id)); }
internal GitBlob(GitRepository repository, GitBucket rdr, GitId id) : base(repository, id) { _rdr = rdr; }
/// <summary> /// Return length of this hash in bytes /// </summary> /// <param name="type"></param> /// <returns></returns> /// <exception cref="ArgumentOutOfRangeException"></exception> public static int HashLength(this GitIdType type) { return(GitId.HashLength(type)); }
internal GitCommit(GitRepository repository, GitObjectBucket objectReader, GitId id) : base(repository, id) { _rb = new GitCommitObjectBucket(objectReader); }
internal GitTagObject(GitRepository repository, GitObjectBucket rdr, GitId id) : base(repository, id) { _rb = new GitTagObjectBucket(rdr); }