mirror of
https://github.com/stablyai/orca.git
synced 2026-10-26 00:03:55 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user