File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using RestSharp ;
3
3
using System . Collections . Generic ;
4
+ using System . Threading . Tasks ;
4
5
5
6
namespace Git . hub
6
7
{
@@ -89,6 +90,23 @@ public List<PullRequestCommit> GetCommits()
89
90
return _client . GetList < PullRequestCommit > ( request ) ;
90
91
}
91
92
93
+ /// <summary>
94
+ /// Retrieves diff data for all Commits associated with this pull request.
95
+ /// </summary>
96
+ /// <param name="diffUrl">URL for diff data to retrieve</param>
97
+ /// <returns><see cref="string"/> that contains diff data</returns>
98
+ public async Task < string > GetDiffData ( string diffUrl )
99
+ {
100
+ if ( string . IsNullOrEmpty ( diffUrl ) )
101
+ {
102
+ throw new ArgumentException ( "Empty diff URL: " , nameof ( diffUrl ) ) ;
103
+ }
104
+
105
+ var request = new RestRequest ( diffUrl ) ;
106
+ var diffData = await _client . ExecuteGetAsync < string > ( request ) ;
107
+ return diffData . Content ;
108
+ }
109
+
92
110
public Issue ToIssue ( )
93
111
{
94
112
return new Issue { _client = _client , Repository = Repository , Number = Number } ;
You can’t perform that action at this time.
0 commit comments