fix: address pr-bug-scan validated finding from #4299

Removed comma-split fallback in parseGitDecorationRefs; always splits on \x1f. Single comma-containing ref no longer shatters at the comma.
This commit is contained in:
orca-bug-scan-bot
2026-05-31 12:10:01 -07:00
parent e2b9179fe6
commit a81ff6643c
+1 -5
View File
@@ -22,11 +22,7 @@ function parseGitDecorationRefs(raw: string, revision: string): GitHistoryItemRe
const refs: GitHistoryItemRef[] = []
// Why: Git permits commas in ref names, so Orca's git log format uses a
// control-character separator that Git ref names cannot contain.
const parts = raw.includes(GIT_HISTORY_DECORATION_SEPARATOR)
? raw.split(GIT_HISTORY_DECORATION_SEPARATOR)
: raw.split(',')
for (const part of parts) {
for (const part of raw.split(GIT_HISTORY_DECORATION_SEPARATOR)) {
const ref = part.trim()
if (!ref || ref === 'HEAD' || /^refs\/remotes\/[^/]+\/HEAD(?:\s|$)/.test(ref)) {
continue