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

Commit 777bd2a

Browse files
authored
Merge pull request #524 from github/fixes/472-link-document-casing
Use ProjectItem.Name for file name consistency
2 parents 6256763 + e77d63c commit 777bd2a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/GitHub.VisualStudio/Helpers/ActiveDocumentSnapshot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class ActiveDocumentSnapshot : IActiveDocumentSnapshot
1919
public ActiveDocumentSnapshot([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
2020
{
2121
StartLine = EndLine = -1;
22-
Name = Services.Dte2?.ActiveDocument?.FullName;
22+
Name = Services.Dte2?.ActiveDocument?.ProjectItem.Name;
2323

2424
var textManager = serviceProvider.GetService(typeof(SVsTextManager)) as IVsTextManager;
2525
Debug.Assert(textManager != null, "No SVsTextManager service available");

src/UnitTests/GitHub.Exports/SimpleRepositoryModelTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ static void SetupRepository(string sha)
4444
[InlineData(17, true, "https://github.com/foo/bar", "", @"src\dir\file1.cs", -1, 2, "https://github.com/foo/bar")]
4545
[InlineData(18, true, null, "123123", @"src\dir\file1.cs", 1, 2, null)]
4646
[InlineData(19, false, "[email protected]/foo/bar", "123123", @"src\dir\file1.cs", -1, -1, "https://github.com/foo/bar/blob/123123/src/dir/file1.cs")]
47+
[InlineData(20, false, "[email protected]/foo/bar", "123123", @"src\dir\File1.cs", -1, -1, "https://github.com/foo/bar/blob/123123/src/dir/File1.cs")]
48+
[InlineData(21, false, "[email protected]/foo/bar", "123123", @"src\dir\ThisIsFile1.cs", -1, -1, "https://github.com/foo/bar/blob/123123/src/dir/ThisIsFile1.cs")]
4749
public void GenerateUrl(int testid, bool createRootedPath, string baseUrl, string sha, string path, int startLine, int endLine, string expected)
4850
{
4951
SetupRepository(sha);

0 commit comments

Comments
 (0)