public GitCommit(GitId id, string commitMessage, DateTime date, GitAuthor author) { Id = id; CommitMessage = commitMessage ?? throw new ArgumentNullException(nameof(commitMessage)); Date = date; Author = author ?? throw new ArgumentNullException(nameof(author)); }
public GitTag(string name, GitId commit) { if (String.IsNullOrWhiteSpace(name)) { throw new ArgumentException("Value must not be null or whitespace", nameof(name)); } Name = name; Commit = commit; }
public GitCommit(GitId id, string commitMessage, DateTime date, GitAuthor author) { if (id.IsNull) { throw new ArgumentException("Commit id must not be empty", nameof(id)); } Id = id; CommitMessage = commitMessage ?? throw new ArgumentNullException(nameof(commitMessage)); Date = date; Author = author ?? throw new ArgumentNullException(nameof(author)); }
/// <inheritdoc /> public IReadOnlyList <GitNote> GetNotes(GitId id) { var gitObject = m_Repository.Lookup <GitObject>(id.Id); if (gitObject is null) { throw new GitObjectNotFoundException($"Git object '{id}' was not found. Cannot retrieve notes for object."); } return(m_Repository.Notes[gitObject.Id] .Select(ToGitNote) .ToList()); }
public GitNote(GitId target, string @namespace, string message) { if (target.IsNull) { throw new ArgumentException("Object id must not be empty", nameof(target)); } if (String.IsNullOrWhiteSpace(@namespace)) { throw new ArgumentException("Value must not be null or whitespace", nameof(@namespace)); } Target = target; Namespace = @namespace; Message = message ?? throw new ArgumentNullException(nameof(message)); }
/// <inheritdoc /> public IReadOnlyList <GitCommit> GetCommits(GitId?fromCommit, GitId toCommit) { // Set up commit filter var filter = new CommitFilter() { IncludeReachableFrom = toCommit.Id }; if (fromCommit.HasValue) { filter.ExcludeReachableFrom = fromCommit.Value.Id; } return(m_Repository.Commits.QueryBy(filter) .Select(ToGitCommit) .ToList()); }