Skip to content

Commit 61a9a3c

Browse files
authored
fix: wrong git path on windows (#9399)
* fix: wong git path on windows * test(snapshot): update snapshots 0518144 for windows-latest --------- Co-authored-by: yufeih <[email protected]>
1 parent 791db69 commit 61a9a3c

File tree

141 files changed

+769
-769
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+769
-769
lines changed

src/Docfx.Common/Git/GitUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ record Repo(string path, string url, string branch);
4242
{
4343
Repo = repo.url,
4444
Branch = repo.branch,
45-
Path = Path.GetRelativePath(repo.path, filePath),
45+
Path = Path.GetRelativePath(repo.path, filePath).Replace('\\', '/'),
4646
};
4747
}
4848

test/docfx.Snapshot.Tests/SamplesTest.CSharp.Windows/api/CSharp10.ConstantInterpolatedStrings.html.view.verified.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
},
162162
"source": {
163163
"remote": {
164-
"path": "samples\\csharp\\src\\CSharp10.cs",
164+
"path": "samples/csharp/src/CSharp10.cs",
165165
"branch": "main",
166166
"repo": "https://github.com/dotnet/docfx"
167167
},
@@ -179,7 +179,7 @@
179179
"summary": "",
180180
"platform": null,
181181
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ConstantInterpolatedStrings_S1.md&value=---%0Auid%3A%20CSharp10.ConstantInterpolatedStrings.S1%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
182-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L23",
182+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L23",
183183
"remarks": "",
184184
"conceptual": "",
185185
"implements": "",
@@ -295,7 +295,7 @@
295295
},
296296
"source": {
297297
"remote": {
298-
"path": "samples\\csharp\\src\\CSharp10.cs",
298+
"path": "samples/csharp/src/CSharp10.cs",
299299
"branch": "main",
300300
"repo": "https://github.com/dotnet/docfx"
301301
},
@@ -313,7 +313,7 @@
313313
"summary": "",
314314
"platform": null,
315315
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ConstantInterpolatedStrings_S2.md&value=---%0Auid%3A%20CSharp10.ConstantInterpolatedStrings.S2%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
316-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L24",
316+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L24",
317317
"remarks": "",
318318
"conceptual": "",
319319
"implements": "",
@@ -429,7 +429,7 @@
429429
},
430430
"source": {
431431
"remote": {
432-
"path": "samples\\csharp\\src\\CSharp10.cs",
432+
"path": "samples/csharp/src/CSharp10.cs",
433433
"branch": "main",
434434
"repo": "https://github.com/dotnet/docfx"
435435
},
@@ -447,7 +447,7 @@
447447
"summary": "",
448448
"platform": null,
449449
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ConstantInterpolatedStrings_S3.md&value=---%0Auid%3A%20CSharp10.ConstantInterpolatedStrings.S3%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
450-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L25",
450+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L25",
451451
"remarks": "",
452452
"conceptual": "",
453453
"implements": "",
@@ -497,7 +497,7 @@
497497
"type": "class",
498498
"source": {
499499
"remote": {
500-
"path": "samples\\csharp\\src\\CSharp10.cs",
500+
"path": "samples/csharp/src/CSharp10.cs",
501501
"branch": "main",
502502
"repo": "https://github.com/dotnet/docfx"
503503
},
@@ -1084,7 +1084,7 @@
10841084
},
10851085
"yamlmime": "ManagedReference",
10861086
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ConstantInterpolatedStrings.md&value=---%0Auid%3A%20CSharp10.ConstantInterpolatedStrings%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
1087-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L21",
1087+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L21",
10881088
"summary": "",
10891089
"remarks": "",
10901090
"conceptual": "",

test/docfx.Snapshot.Tests/SamplesTest.CSharp.Windows/api/CSharp10.Issue7737.html.view.verified.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
},
116116
"source": {
117117
"remote": {
118-
"path": "samples\\csharp\\src\\CSharp10.cs",
118+
"path": "samples/csharp/src/CSharp10.cs",
119119
"branch": "main",
120120
"repo": "https://github.com/dotnet/docfx"
121121
},
@@ -178,7 +178,7 @@
178178
"summary": "<p sourcefile=\"api/CSharp10.Issue7737.yml\" sourcestartlinenumber=\"1\"><xref href=\"System.Exception\" data-throw-if-not-resolved=\"false\"></xref></p>\n",
179179
"platform": null,
180180
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_Issue7737_Foo.md&value=---%0Auid%3A%20CSharp10.Issue7737.Foo%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
181-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L33",
181+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L33",
182182
"remarks": "",
183183
"conceptual": "",
184184
"implements": "",
@@ -227,7 +227,7 @@
227227
"type": "class",
228228
"source": {
229229
"remote": {
230-
"path": "samples\\csharp\\src\\CSharp10.cs",
230+
"path": "samples/csharp/src/CSharp10.cs",
231231
"branch": "main",
232232
"repo": "https://github.com/dotnet/docfx"
233233
},
@@ -814,7 +814,7 @@
814814
},
815815
"yamlmime": "ManagedReference",
816816
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_Issue7737.md&value=---%0Auid%3A%20CSharp10.Issue7737%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
817-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L28",
817+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L28",
818818
"summary": "",
819819
"remarks": "",
820820
"conceptual": "",

test/docfx.Snapshot.Tests/SamplesTest.CSharp.Windows/api/CSharp10.ParameterlessStructConstructors.html.view.verified.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
},
116116
"source": {
117117
"remote": {
118-
"path": "samples\\csharp\\src\\CSharp10.cs",
118+
"path": "samples/csharp/src/CSharp10.cs",
119119
"branch": "main",
120120
"repo": "https://github.com/dotnet/docfx"
121121
},
@@ -177,7 +177,7 @@
177177
"summary": "",
178178
"platform": null,
179179
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ParameterlessStructConstructors__ctor.md&value=---%0Auid%3A%20CSharp10.ParameterlessStructConstructors.%23ctor%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
180-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L15",
180+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L15",
181181
"remarks": "",
182182
"conceptual": "",
183183
"implements": "",
@@ -300,7 +300,7 @@
300300
},
301301
"source": {
302302
"remote": {
303-
"path": "samples\\csharp\\src\\CSharp10.cs",
303+
"path": "samples/csharp/src/CSharp10.cs",
304304
"branch": "main",
305305
"repo": "https://github.com/dotnet/docfx"
306306
},
@@ -318,7 +318,7 @@
318318
"summary": "",
319319
"platform": null,
320320
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ParameterlessStructConstructors_X.md&value=---%0Auid%3A%20CSharp10.ParameterlessStructConstructors.X%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
321-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L11",
321+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L11",
322322
"remarks": "",
323323
"conceptual": "",
324324
"implements": "",
@@ -442,7 +442,7 @@
442442
},
443443
"source": {
444444
"remote": {
445-
"path": "samples\\csharp\\src\\CSharp10.cs",
445+
"path": "samples/csharp/src/CSharp10.cs",
446446
"branch": "main",
447447
"repo": "https://github.com/dotnet/docfx"
448448
},
@@ -504,7 +504,7 @@
504504
"summary": "",
505505
"platform": null,
506506
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ParameterlessStructConstructors_Description.md&value=---%0Auid%3A%20CSharp10.ParameterlessStructConstructors.Description%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
507-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L13",
507+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L13",
508508
"remarks": "",
509509
"conceptual": "",
510510
"implements": "",
@@ -621,7 +621,7 @@
621621
},
622622
"source": {
623623
"remote": {
624-
"path": "samples\\csharp\\src\\CSharp10.cs",
624+
"path": "samples/csharp/src/CSharp10.cs",
625625
"branch": "main",
626626
"repo": "https://github.com/dotnet/docfx"
627627
},
@@ -683,7 +683,7 @@
683683
"summary": "",
684684
"platform": null,
685685
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ParameterlessStructConstructors_Y.md&value=---%0Auid%3A%20CSharp10.ParameterlessStructConstructors.Y%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
686-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L12",
686+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L12",
687687
"remarks": "",
688688
"conceptual": "",
689689
"implements": "",
@@ -733,7 +733,7 @@
733733
"type": "struct",
734734
"source": {
735735
"remote": {
736-
"path": "samples\\csharp\\src\\CSharp10.cs",
736+
"path": "samples/csharp/src/CSharp10.cs",
737737
"branch": "main",
738738
"repo": "https://github.com/dotnet/docfx"
739739
},
@@ -1219,7 +1219,7 @@
12191219
},
12201220
"yamlmime": "ManagedReference",
12211221
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ParameterlessStructConstructors.md&value=---%0Auid%3A%20CSharp10.ParameterlessStructConstructors%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
1222-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L9",
1222+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L9",
12231223
"summary": "",
12241224
"remarks": "",
12251225
"conceptual": "",

test/docfx.Snapshot.Tests/SamplesTest.CSharp.Windows/api/CSharp10.ReadOnlyRecordStruct.html.view.verified.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
},
256256
"source": {
257257
"remote": {
258-
"path": "samples\\csharp\\src\\CSharp10.cs",
258+
"path": "samples/csharp/src/CSharp10.cs",
259259
"branch": "main",
260260
"repo": "https://github.com/dotnet/docfx"
261261
},
@@ -317,7 +317,7 @@
317317
"summary": "",
318318
"platform": null,
319319
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ReadOnlyRecordStruct__ctor_System_Double_System_Double_System_Double_.md&value=---%0Auid%3A%20CSharp10.ReadOnlyRecordStruct.%23ctor(System.Double%2CSystem.Double%2CSystem.Double)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
320-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L3",
320+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L3",
321321
"remarks": "",
322322
"conceptual": "",
323323
"implements": "",
@@ -441,7 +441,7 @@
441441
},
442442
"source": {
443443
"remote": {
444-
"path": "samples\\csharp\\src\\CSharp10.cs",
444+
"path": "samples/csharp/src/CSharp10.cs",
445445
"branch": "main",
446446
"repo": "https://github.com/dotnet/docfx"
447447
},
@@ -503,7 +503,7 @@
503503
"summary": "",
504504
"platform": null,
505505
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ReadOnlyRecordStruct_X.md&value=---%0Auid%3A%20CSharp10.ReadOnlyRecordStruct.X%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
506-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L3",
506+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L3",
507507
"remarks": "",
508508
"conceptual": "",
509509
"implements": "",
@@ -620,7 +620,7 @@
620620
},
621621
"source": {
622622
"remote": {
623-
"path": "samples\\csharp\\src\\CSharp10.cs",
623+
"path": "samples/csharp/src/CSharp10.cs",
624624
"branch": "main",
625625
"repo": "https://github.com/dotnet/docfx"
626626
},
@@ -682,7 +682,7 @@
682682
"summary": "",
683683
"platform": null,
684684
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ReadOnlyRecordStruct_Y.md&value=---%0Auid%3A%20CSharp10.ReadOnlyRecordStruct.Y%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
685-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L3",
685+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L3",
686686
"remarks": "",
687687
"conceptual": "",
688688
"implements": "",
@@ -799,7 +799,7 @@
799799
},
800800
"source": {
801801
"remote": {
802-
"path": "samples\\csharp\\src\\CSharp10.cs",
802+
"path": "samples/csharp/src/CSharp10.cs",
803803
"branch": "main",
804804
"repo": "https://github.com/dotnet/docfx"
805805
},
@@ -861,7 +861,7 @@
861861
"summary": "",
862862
"platform": null,
863863
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ReadOnlyRecordStruct_Z.md&value=---%0Auid%3A%20CSharp10.ReadOnlyRecordStruct.Z%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
864-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L3",
864+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L3",
865865
"remarks": "",
866866
"conceptual": "",
867867
"implements": "",
@@ -911,7 +911,7 @@
911911
"type": "struct",
912912
"source": {
913913
"remote": {
914-
"path": "samples\\csharp\\src\\CSharp10.cs",
914+
"path": "samples/csharp/src/CSharp10.cs",
915915
"branch": "main",
916916
"repo": "https://github.com/dotnet/docfx"
917917
},
@@ -1443,7 +1443,7 @@
14431443
},
14441444
"yamlmime": "ManagedReference",
14451445
"docurl": "https://github.com/dotnet/docfx/new/main/apiSpec/new?filename=CSharp10_ReadOnlyRecordStruct.md&value=---%0Auid%3A%20CSharp10.ReadOnlyRecordStruct%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A",
1446-
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples\\csharp\\src\\CSharp10.cs/#L3",
1446+
"sourceurl": "https://github.com/dotnet/docfx/blob/main/samples/csharp/src/CSharp10.cs/#L3",
14471447
"summary": "",
14481448
"remarks": "",
14491449
"conceptual": "",

0 commit comments

Comments
 (0)