Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 815490b

Browse files
committed
Commit[] no longer accepts \ in path
Pass gitHubFilePath not winFilePath to FakeDiffService.Diff.
1 parent 26f5e2d commit 815490b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/GitHub.InlineReviews.UnitTests/Services/PullRequestSessionServiceTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Line 2
181181

182182
using (var diffService = new FakeDiffService(winFilePath, baseContents))
183183
{
184-
var diff = await diffService.Diff(winFilePath, headContents);
184+
var diff = await diffService.Diff(gitHubFilePath, headContents);
185185
var pullRequest = CreatePullRequest(gitHubFilePath, comment);
186186
var target = CreateTarget(diffService);
187187

@@ -334,7 +334,7 @@ static PullRequestDetailModel CreatePullRequest(
334334
HeadRefName = "HEAD",
335335
HeadRefSha = "HEAD_SHA",
336336
HeadRepositoryOwner = "owner",
337-
ChangedFiles = new []
337+
ChangedFiles = new[]
338338
{
339339
new PullRequestFileModel { FileName = filePath },
340340
new PullRequestFileModel { FileName = "other.cs" },

test/GitHub.InlineReviews.UnitTests/TestDoubles/FakeDiffService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public Task<IReadOnlyList<DiffChunk>> Diff(IRepository repo, string baseSha, str
6868
return Task.FromResult<IReadOnlyList<DiffChunk>>(DiffUtilities.ParseFragment(patch).ToList());
6969
}
7070

71-
public Task<IReadOnlyList<DiffChunk>> Diff(string path, string baseSha, byte[] contents)
71+
Task<IReadOnlyList<DiffChunk>> Diff(string path, string baseSha, byte[] contents)
7272
{
7373
var tip = repository.Head.Tip.Sha;
7474
var stream = contents != null ? new MemoryStream(contents) : new MemoryStream();
@@ -78,7 +78,7 @@ public Task<IReadOnlyList<DiffChunk>> Diff(string path, string baseSha, byte[] c
7878
return Task.FromResult<IReadOnlyList<DiffChunk>>(DiffUtilities.ParseFragment(patch).ToList());
7979
}
8080

81-
public Task<IReadOnlyList<DiffChunk>> Diff(string path, string contents)
81+
internal Task<IReadOnlyList<DiffChunk>> Diff(string path, string contents)
8282
{
8383
return Diff(path, repository.Head.Tip.Sha, Encoding.UTF8.GetBytes(contents));
8484
}

0 commit comments

Comments
 (0)