File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 11using System ;
22using RestSharp ;
33using System . Collections . Generic ;
4+ using System . Threading . Tasks ;
45
56namespace Git . hub
67{
@@ -89,6 +90,23 @@ public List<PullRequestCommit> GetCommits()
8990 return _client . GetList < PullRequestCommit > ( request ) ;
9091 }
9192
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+
92110 public Issue ToIssue ( )
93111 {
94112 return new Issue { _client = _client , Repository = Repository , Number = Number } ;
You can’t perform that action at this time.
0 commit comments