Skip to content

Commit 8d3a146

Browse files
committed
Updates repo name to better reflect folder
Related to #1854
1 parent 6b9907f commit 8d3a146

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1515
- Removes dependency on GitKraken Authentication extension
1616
- Changes date formatting to follow the VS Code language locale by default
1717
- Changes framing of premium features into GitLens+
18+
- Changes repository naming to better reflect its folder name, related to [#1854](https://github.com/gitkraken/vscode-gitlens/issues/1854)
1819

1920
### Fixed
2021

src/git/models/repository.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,20 +214,12 @@ export class Repository implements Disposable {
214214
if (folder != null) {
215215
if (root) {
216216
this.name = folder.name;
217-
this.formattedName = this.name;
218217
} else {
219218
const relativePath = container.git.getRelativePath(uri, folder.uri);
220-
if (relativePath) {
221-
this.name = `${folder.name}/${relativePath}`;
222-
this.formattedName = `${folder.name} (${relativePath})`;
223-
} else {
224-
this.name = folder.name;
225-
this.formattedName = this.name;
226-
}
219+
this.name = relativePath ? relativePath : folder.name;
227220
}
228221
} else {
229222
this.name = basename(uri.path);
230-
this.formattedName = this.name;
231223

232224
// TODO@eamodio should we create a fake workspace folder?
233225
// folder = {
@@ -236,6 +228,7 @@ export class Repository implements Disposable {
236228
// index: container.git.repositoryCount,
237229
// };
238230
}
231+
this.formattedName = this.name;
239232
this.index = folder?.index ?? container.git.repositoryCount;
240233

241234
this.id = asRepoComparisonKey(uri);

0 commit comments

Comments
 (0)