File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -505,13 +505,6 @@ export class Git {
505
505
506
506
return path . normalize ( pathUri . fsPath ) ;
507
507
}
508
-
509
- // On Windows, there are cases in which the normalized path for a mapped folder contains a trailing `\`
510
- // character (ex: \\server\folder\) due to the implementation of `path.normalize()`. This behaviour is
511
- // by design as documented in https://github.com/nodejs/node/issues/1765.
512
- if ( repoUri . authority . length !== 0 ) {
513
- return repoPath . replace ( / \\ $ / , '' ) ;
514
- }
515
508
}
516
509
517
510
return repoPath ;
Original file line number Diff line number Diff line change @@ -314,6 +314,13 @@ export function pathEquals(a: string, b: string): boolean {
314
314
* casing.
315
315
*/
316
316
export function relativePath ( from : string , to : string ) : string {
317
+ // On Windows, there are cases in which `from` is a path that contains a trailing `\` character
318
+ // (ex: C:\, \\server\folder\) due to the implementation of `path.normalize()`. This behavior is
319
+ // by design as documented in https://github.com/nodejs/node/issues/1765.
320
+ if ( isWindows ) {
321
+ from = from . replace ( / \\ $ / , '' ) ;
322
+ }
323
+
317
324
if ( isDescendant ( from , to ) && from . length < to . length ) {
318
325
return to . substring ( from . length + 1 ) ;
319
326
}
You can’t perform that action at this time.
0 commit comments