From ad132271ae30d6a5f12d3b100289aa07acadff44 Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Wed, 15 Nov 2023 14:51:30 +0800 Subject: [PATCH] `default-branch-button` - Don't show on the default branch (#7062) --- source/github-helpers/is-default-branch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/github-helpers/is-default-branch.ts b/source/github-helpers/is-default-branch.ts index 4b257d2b99d..6949bf8cb14 100644 --- a/source/github-helpers/is-default-branch.ts +++ b/source/github-helpers/is-default-branch.ts @@ -24,5 +24,5 @@ export default async function isDefaultBranch(): Promise { // defaultBranch === 'a/b' && currentBranch === 'a' const path = parts.join('/'); const defaultBranch = await getDefaultBranch(); - return path === defaultBranch || defaultBranch.startsWith(`${path}/`); + return path === defaultBranch || path.startsWith(`${defaultBranch}/`); }