Beispiel #1
0
 public PullRequest(Uri url, Uri htmlUrl, Uri diffUrl, Uri patchUrl, Uri issueUrl, Uri statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset?closedAt, DateTimeOffset?mergedAt, GitReference head, GitReference @base, User user, User assignee, bool?mergeable, User mergedBy, int comments, int commits, int additions, int deletions, int changedFiles, Milestone milestone)
 {
     Url          = url;
     HtmlUrl      = htmlUrl;
     DiffUrl      = diffUrl;
     PatchUrl     = patchUrl;
     IssueUrl     = issueUrl;
     StatusesUrl  = statusesUrl;
     Number       = number;
     State        = state;
     Title        = title;
     Body         = body;
     CreatedAt    = createdAt;
     UpdatedAt    = updatedAt;
     ClosedAt     = closedAt;
     MergedAt     = mergedAt;
     Head         = head;
     Base         = @base;
     User         = user;
     Assignee     = assignee;
     Mergeable    = mergeable;
     MergedBy     = mergedBy;
     Comments     = comments;
     Commits      = commits;
     Additions    = additions;
     Deletions    = deletions;
     ChangedFiles = changedFiles;
     Milestone    = milestone;
 }
Beispiel #2
0
 public RepositoryTag(string name, GitReference commit, string zipballUrl, string tarballUrl)
 {
     Name       = name;
     Commit     = commit;
     ZipballUrl = zipballUrl;
     TarballUrl = tarballUrl;
 }
 public PullRequest(Uri url, Uri htmlUrl, Uri diffUrl, Uri patchUrl, Uri issueUrl, Uri statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? closedAt, DateTimeOffset? mergedAt, GitReference head, GitReference @base, User user, User assignee, bool? mergeable, User mergedBy, int comments, int commits, int additions, int deletions, int changedFiles)
 {
     Url = url;
     HtmlUrl = htmlUrl;
     DiffUrl = diffUrl;
     PatchUrl = patchUrl;
     IssueUrl = issueUrl;
     StatusesUrl = statusesUrl;
     Number = number;
     State = state;
     Title = title;
     Body = body;
     CreatedAt = createdAt;
     UpdatedAt = updatedAt;
     ClosedAt = closedAt;
     MergedAt = mergedAt;
     Head = head;
     Base = @base;
     User = user;
     Assignee = assignee;
     Mergeable = mergeable;
     MergedBy = mergedBy;
     Comments = comments;
     Commits = commits;
     Additions = additions;
     Deletions = deletions;
     ChangedFiles = changedFiles;
 }
Beispiel #4
0
 public PullRequest(long id, string url, string htmlUrl, string diffUrl, string patchUrl, string issueUrl, string statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset?closedAt, DateTimeOffset?mergedAt, GitReference head, GitReference @base, User user, User assignee, IReadOnlyList <User> assignees, bool?mergeable, User mergedBy, string mergeCommitSha, int comments, int commits, int additions, int deletions, int changedFiles, Milestone milestone, bool locked, IReadOnlyList <User> requestedReviewers)
 {
     Id                 = id;
     Url                = url;
     HtmlUrl            = htmlUrl;
     DiffUrl            = diffUrl;
     PatchUrl           = patchUrl;
     IssueUrl           = issueUrl;
     StatusesUrl        = statusesUrl;
     Number             = number;
     State              = state;
     Title              = title;
     Body               = body;
     CreatedAt          = createdAt;
     UpdatedAt          = updatedAt;
     ClosedAt           = closedAt;
     MergedAt           = mergedAt;
     Head               = head;
     Base               = @base;
     User               = user;
     Assignee           = assignee;
     Assignees          = assignees;
     Mergeable          = mergeable;
     MergedBy           = mergedBy;
     MergeCommitSha     = mergeCommitSha;
     Comments           = comments;
     Commits            = commits;
     Additions          = additions;
     Deletions          = deletions;
     ChangedFiles       = changedFiles;
     Milestone          = milestone;
     Locked             = locked;
     RequestedReviewers = requestedReviewers;
 }
Beispiel #5
0
 public RepositoryTag(string name, GitReference commit, string zipballUrl, string tarballUrl)
 {
     Name = name;
     Commit = commit;
     ZipballUrl = zipballUrl;
     TarballUrl = tarballUrl;
 }
Beispiel #6
0
 private Commit GetCommitFromGithubCommit(GitReference commit)
 {
     return new Commit
     {
         //Author = commit.Author.Name,
         //Message = commit.Message,
         Revision = commit.Sha
     };
 }
Beispiel #7
0
 public Commit(string url, string label, string @ref, string sha, User user, Repository repository, string message, SignatureResponse author, SignatureResponse committer, GitReference tree, IEnumerable <GitReference> parents, int commentCount)
     : base(url, label, @ref, sha, user, repository)
 {
     Message      = message;
     Author       = author;
     Committer    = committer;
     Tree         = tree;
     Parents      = parents;
     CommentCount = commentCount;
 }
Beispiel #8
0
        public Commit(string url, string label, string @ref, string sha, User user, Repository repository, string message, Committer author, Committer committer, GitReference tree, IEnumerable <GitReference> parents, int commentCount)
            : base(url, label, @ref, sha, user, repository)
        {
            Ensure.ArgumentNotNull(parents, nameof(parents));

            Message      = message;
            Author       = author;
            Committer    = committer;
            Tree         = tree;
            Parents      = new ReadOnlyCollection <GitReference>(parents.ToList());
            CommentCount = commentCount;
        }
Beispiel #9
0
        public Commit(string url, string label, string @ref, string sha, User user, Repository repository, string message, Committer author, Committer committer, GitReference tree, IEnumerable<GitReference> parents, int commentCount)
            : base(url, label, @ref, sha, user, repository)
        {
            Ensure.ArgumentNotNull(parents, "parents");

            Message = message;
            Author = author;
            Committer = committer;
            Tree = tree;
            Parents = new ReadOnlyCollection<GitReference>(parents.ToList());
            CommentCount = commentCount;
        }
Beispiel #10
0
#pragma warning disable CS0618 // Type or member is obsolete
        public Branch(string name, GitReference commit, BranchProtection protection)
            : this(name, commit, protection, false)
        {
        }
Beispiel #11
0
 public Branch(string name, GitReference commit, bool @protected)
 {
     Name      = name;
     Commit    = commit;
     Protected = @protected;
 }
Beispiel #12
0
#pragma warning disable CS0618 // Type or member is obsolete
        public Branch(string name, GitReference commit, BranchProtection protection)
        {
            Name = name;
            Commit = commit;
            Protection = protection;
        }
Beispiel #13
0
 public Branch(string name, GitReference commit)
 {
     Name   = name;
     Commit = commit;
 }
Beispiel #14
0
#pragma warning disable CS0618 // Type or member is obsolete
        public Branch(string name, GitReference commit, BranchProtection protection)
            : this(name, commit, protection, false)
        {
        }
Beispiel #15
0
        private static string CreateLink(GitReference reference)
        {
            if (reference.Repository != null)
            {
                var baseHtml = reference.Repository.HtmlUrl + "/tree/" + reference.Ref;
                return string.Format("<a href='{0}'>{1}</a>", baseHtml, reference.Label);
            }

            return "<a href='#'>unknown repository</a>";
        }
Beispiel #16
0
 public Branch(string name, GitReference commit, BranchProtection protection)
 {
     Name       = name;
     Commit     = commit;
     Protection = protection;
 }
Beispiel #17
0
#pragma warning restore CS0618 // Type or member is obsolete

#pragma warning disable CS0618 // Type or member is obsolete
        public Branch(string name, GitReference commit, BranchProtection protection, bool @protected)
            : this(name, commit, @protected)
        {
            Protection = protection;
        }
Beispiel #18
0
        public void PerformsCommitSerialization()
        {
            var tree = new GitReference { Sha = "tree-reference", Url = "tree-url" };
            var parent1 = new GitReference { Sha = "parent1-reference", Url = "parent1-url" };
            var parent2 = new GitReference { Sha = "parent2-reference", Url = "parent2-url" };

            var author = new Signature
            {
                Name = "author-name", 
                Email = "author-email", 
                Date = new DateTime(2013, 10, 15, 13, 40, 14, DateTimeKind.Utc)
            };
            
            var committer = new Signature { 
                Name = "committer-name", 
                Email = "committer-email",
                Date = new DateTime(2013, 06, 29, 10, 12, 50, DateTimeKind.Utc)
            };

            var commit = new Commit
            {
                Sha = "commit-reference",
                Url = "commit-url",
                Message = "commit-message",
                Parents = new[]{ parent1, parent2 },
                Tree = tree,
                Author = author,
                Committer = committer,
            };

            var json = new SimpleJsonSerializer().Serialize(commit);

            const string expectedResult = "{\"message\":\"commit-message\"," +
                                            "\"author\":{" +
                                                "\"name\":\"author-name\"," +
                                                "\"email\":\"author-email\"," +
                                                "\"date\":\"2013-10-15T13:40:14Z\"" +
                                            "}," +
                                            "\"committer\":{" +
                                                "\"name\":\"committer-name\"," +
                                                "\"email\":\"committer-email\"," +
                                                "\"date\":\"2013-06-29T10:12:50Z\"" +
                                            "}," +
                                            "\"tree\":{" +
                                                "\"url\":\"tree-url\"," +
                                                "\"sha\":\"tree-reference\"" +
                                            "}," +
                                            "\"parents\":[{" +
                                                "\"url\":\"parent1-url\"," +
                                                "\"sha\":\"parent1-reference\"" +
                                            "}," +
                                            "{" +
                                                "\"url\":\"parent2-url\"," +
                                                "\"sha\":\"parent2-reference\"" +
                                            "}]," +
                                            "\"comment_count\":0," +
                                            "\"url\":\"commit-url\"," +
                                            "\"sha\":\"commit-reference\"" +
                                          "}";

            Assert.Equal(expectedResult, json);
        }
Beispiel #19
0
 public Branch(string name, GitReference commit, bool @protected)
 {
     Name = name;
     Commit = commit;
     Protected = @protected;
 }
Beispiel #20
0
#pragma warning restore CS0618 // Type or member is obsolete

#pragma warning disable CS0618 // Type or member is obsolete
        public Branch(string name, GitReference commit, BranchProtection protection, bool @protected)
            : this(name, commit, @protected)
        {
            Protection = protection;
        }