Skip to content

Commit 670ad96

Browse files
authored
Github Pull Request tab won't open if branch names are reused (#8063)
Fixes #8007
1 parent 508c1b3 commit 670ad96

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/github/pullRequestGitHelper.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,9 @@ export class PullRequestGitHelper {
329329
): Promise<PullRequestMetadata | undefined> {
330330
try {
331331
const configKey = this.getMetadataKeyForBranch(branchName);
332-
const configValue = await repository.getConfig(configKey);
333-
return PullRequestGitHelper.parsePullRequestMetadata(configValue);
332+
const allConfigs = await repository.getConfigs();
333+
const matchingConfigs = allConfigs.filter(config => config.key === configKey).sort((a, b) => b.value < a.value ? 1 : -1);
334+
return PullRequestGitHelper.parsePullRequestMetadata(matchingConfigs[0].value);
334335
} catch (_) {
335336
return;
336337
}

0 commit comments

Comments
 (0)