diff --git a/Octokit/Clients/PullRequestsClient.cs b/Octokit/Clients/PullRequestsClient.cs
index 0c3ea179..bb449f9d 100644
--- a/Octokit/Clients/PullRequestsClient.cs
+++ b/Octokit/Clients/PullRequestsClient.cs
@@ -167,7 +167,7 @@ namespace Octokit
/// The owner of the repository
/// The name of the repository
/// The pull request number
- /// A of s which are part of this pull request
+ /// A which are part of this pull request
public Task> Files(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
diff --git a/Octokit/Models/Request/PullRequestRequest.cs b/Octokit/Models/Request/PullRequestRequest.cs
index 9c8a2adc..b4e8cb13 100644
--- a/Octokit/Models/Request/PullRequestRequest.cs
+++ b/Octokit/Models/Request/PullRequestRequest.cs
@@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using System.Globalization;
+using Octokit.Internal;
namespace Octokit
{
@@ -10,6 +11,8 @@ namespace Octokit
public PullRequestRequest()
{
State = ItemState.Open;
+ SortProperty = PullRequestSort.Created;
+ SortDirection = SortDirection.Descending;
}
///
@@ -27,6 +30,18 @@ namespace Octokit
///
public string Base { get; set; }
+ ///
+ /// What property to sort pull requests by.
+ ///
+ [Parameter(Key="sort")]
+ public PullRequestSort SortProperty { get; set; }
+
+ ///
+ /// What direction to sort the pull requests.
+ ///
+ [Parameter(Key="direction")]
+ public SortDirection SortDirection { get; set; }
+
internal string DebuggerDisplay
{
get
@@ -35,4 +50,25 @@ namespace Octokit
}
}
}
+
+ public enum PullRequestSort
+ {
+ ///
+ /// Sort by created date (default)
+ ///
+ Created,
+ ///
+ /// Sort by last updated date
+ ///
+ Updated,
+ ///
+ /// Sort by popularity (comment count)
+ ///
+ Popularity,
+ ///
+ /// Sort by age (filtering by pulls updated in the last month)
+ ///
+ [Parameter(Key="long-running")]
+ LongRunning
+ }
}
diff --git a/Octokit/Models/Response/PullRequestFile.cs b/Octokit/Models/Response/PullRequestFile.cs
index dbf9b336..b8392792 100644
--- a/Octokit/Models/Response/PullRequestFile.cs
+++ b/Octokit/Models/Response/PullRequestFile.cs
@@ -27,16 +27,16 @@ namespace Octokit
Patch = patch;
}
- public string Sha { get; set; }
- public string FileName { get; set; }
- public string Status { get; set; }
- public int Additions { get; set; }
- public int Deletions { get; set; }
- public int Changes { get; set; }
- public Uri BlobUri { get; set; }
- public Uri RawUri { get; set; }
- public Uri ContentsUri { get; set; }
- public string Patch { get; set; }
+ public string Sha { get; protected set; }
+ public string FileName { get; protected set; }
+ public string Status { get; protected set; }
+ public int Additions { get; protected set; }
+ public int Deletions { get; protected set; }
+ public int Changes { get; protected set; }
+ public Uri BlobUri { get; protected set; }
+ public Uri RawUri { get; protected set; }
+ public Uri ContentsUri { get; protected set; }
+ public string Patch { get; protected set; }
internal string DebuggerDisplay
{