Skip to content

Commit 7166117

Browse files
committed
refactor: reuse shared parseSourceControlOwnerRef in AzureDevOpsCli normalizeSourceBranch
1 parent 7185db2 commit 7166117

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

apps/server/src/sourceControl/AzureDevOpsCli.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77

88
import * as VcsProcess from "../vcs/VcsProcess.ts";
99
import * as AzureDevOpsPullRequests from "./azureDevOpsPullRequests.ts";
10-
import type * as SourceControlProvider from "./SourceControlProvider.ts";
10+
import * as SourceControlProvider from "./SourceControlProvider.ts";
1111

1212
const DEFAULT_TIMEOUT_MS = 30_000;
1313

@@ -158,9 +158,9 @@ function normalizeChangeRequestId(reference: string): string {
158158
}
159159

160160
function normalizeSourceBranch(headSelector: string): string {
161-
const trimmed = headSelector.trim();
162-
const ownerSelector = /^([^:/\s]+):(.+)$/u.exec(trimmed);
163-
return ownerSelector?.[2]?.trim() ?? trimmed;
161+
return (
162+
SourceControlProvider.parseSourceControlOwnerRef(headSelector)?.refName ?? headSelector.trim()
163+
);
164164
}
165165

166166
function sourceBranch(input: {

0 commit comments

Comments
 (0)