From 96b550ce1fd0e0be154e03440a52bd7bd0f260b4 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 2 Mar 2022 12:55:47 -0500 Subject: [PATCH] =?UTF-8?q?Fixes=20#1854=20=F0=9F=A4=A6reversed=20argument?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/git/models/repository.ts | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b24d0b..63a7d78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Fixed +- Fixes [#1854](https://github.com/gitkraken/vscode-gitlens/issues/1854) - All repos have the same name - Fixes [#1866](https://github.com/gitkraken/vscode-gitlens/issues/1866) - Copy SHA and Copy Message don't work from the views (commits, branches, etc) - Fixes [#1865](https://github.com/gitkraken/vscode-gitlens/issues/1865) - Value shortOffset out of range for Intl.DateTimeFormat options property timeZoneName - Fixes [#1742](https://github.com/gitkraken/vscode-gitlens/issues/1742) - New file lines keep jumping down diff --git a/src/git/models/repository.ts b/src/git/models/repository.ts index 4f512de..d831e86 100644 --- a/src/git/models/repository.ts +++ b/src/git/models/repository.ts @@ -212,13 +212,18 @@ export class Repository implements Disposable { ) { folder = workspace.getWorkspaceFolder(uri) ?? folder; if (folder != null) { - this.name = folder.name; - if (root) { + this.name = folder.name; this.formattedName = this.name; } else { - const relativePath = container.git.getRelativePath(folder.uri, uri); - this.formattedName = relativePath ? `${this.name} (${relativePath})` : this.name; + const relativePath = container.git.getRelativePath(uri, folder.uri); + if (relativePath) { + this.name = `${folder.name}/${relativePath}`; + this.formattedName = `${folder.name} (${relativePath})`; + } else { + this.name = folder.name; + this.formattedName = this.name; + } } } else { this.name = basename(uri.path);