From 5845f4d562176459a4ec6f5d676ce155240c95a1 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 10 Apr 2020 16:20:58 -0400 Subject: [PATCH] Protects against trailing backslash in UNC path --- src/git/gitService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/git/gitService.ts b/src/git/gitService.ts index 8e3e2b0..7ccd90c 100644 --- a/src/git/gitService.ts +++ b/src/git/gitService.ts @@ -2675,7 +2675,10 @@ export class GitService implements Disposable { ); if (networkPath !== undefined) { return Strings.normalizePath( - repoUri.fsPath.replace(networkPath, `${letter.toLowerCase()}:`), + repoUri.fsPath.replace( + networkPath, + `${letter.toLowerCase()}:${networkPath.endsWith('\\') ? '\\' : ''}`, + ), ); } } catch {}