From 37d9c8444834bc08c440298e4d84e71b02174c95 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Tue, 24 May 2022 20:12:18 +0200 Subject: [PATCH 1/3] fix: Actually use `mainBranches` setting The setting was added in #39 but the code didn't actually use it and relied on the `BRANCHES` constant. --- src/extension.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index a318aeb..26d9d4e 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -115,12 +115,16 @@ function getEditorInfo(): { uri: vscode.Uri | null; fileName: string | null } { return { uri, fileName } } -const BRANCHES = ["main", "master", "trunk", "dev", "develop"] +function mainBranches() { + return vscode.workspace + .getConfiguration("githubinator") + .get("mainBranches", ["main"]) +} async function findShaForBranches( gitDir: string, ): Promise<[string, string] | null> { - for (let branch of BRANCHES) { + for (let branch of mainBranches()) { const sha = await git.getSHAForBranch(gitDir, branch) if (sha == null) { continue @@ -171,7 +175,7 @@ async function githubinator({ if (mainBranch) { const res = await findShaForBranches(gitDir) if (res == null) { - return err(`Could not find SHA for branch in ${BRANCHES}`) + return err(`Could not find SHA for branch in ${mainBranches()}`) } headBranch = res } else { From a0a0cedd2fee5a8dbe73b42b13bdfc52d9e7afa5 Mon Sep 17 00:00:00 2001 From: Christopher Dignam Date: Thu, 26 May 2022 18:01:46 -0400 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b3957f..8714e00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## 2.0.1 - 2022-05-26 + +### Fixed + +- `mainBranches` configuration option not being used. Thanks @CvX! (#56) + ## 2.0.0 - 2021-12-09 ### Fixed From 117c4a70bab79d2f95f4d2cc71e76a56d33accbc Mon Sep 17 00:00:00 2001 From: Christopher Dignam Date: Thu, 26 May 2022 18:05:04 -0400 Subject: [PATCH 3/3] version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b95602..f8a24b8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "githubinator", "displayName": "Githubinator", "description": "Quickly open files on Github and other providers. View blame information, copy permalinks and more. See the \"commands\" section of the README for more details.", - "version": "1.1.1", + "version": "2.0.1", "publisher": "chdsbd", "license": "SEE LICENSE IN LICENSE", "icon": "images/logo256.png",