- Replace chained array transforms with explicit loops across mobile and server paths - Tighten provider, git, and orchestration parsing while preserving behavior - Improve remote-connect UI data shaping and thread activity filtering
Showing the changes to apps/server/src/sourceControl/SourceControlProviderDiscovery.ts (1 of 54 files). Show all
Unified · Split
| @@ -96,15 +96,24 @@ export function unknownAuth(detail?: string): SourceControlProviderAuth { · 95 unmodified lines | |||
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | export function combinedAuthOutput(input: SourceControlAuthProbeInput): string { | 98 | export function combinedAuthOutput(input: SourceControlAuthProbeInput): string { |
| 99 | return [input.stdout, input.stderr].filter((entry) => entry.trim().length > 0).join("\n"); | 99 | const parts: string[] = []; |
| 100 | for (const entry of [input.stdout, input.stderr]) { | ||
| 101 | if (entry.trim().length > 0) { | ||
| 102 | parts.push(entry); | ||
| 103 | } | ||
| 104 | } | ||
| 105 | return parts.join("\n"); | ||
| 100 | } | 106 | } |
| 101 | 107 | ||
| 102 | function sanitizedAuthLines(text: string): ReadonlyArray<string> { | 108 | function sanitizedAuthLines(text: string): ReadonlyArray<string> { |
| 103 | return text | 109 | const lines: string[] = []; |
| 104 | .split(/\r?\n/) | 110 | for (const entry of text.split(/\r?\n/)) { |
| 105 | .map((entry) => entry.trim()) | 111 | const line = entry.trim(); |
| 106 | .filter((entry) => entry.length > 0) | 112 | if (line.length === 0) continue; |
| 107 | .filter((entry) => !/^[-\s]*token(?:\s+scopes?)?:/iu.test(entry)); | 113 | if (/^[-\s]*token(?:\s+scopes?)?:/iu.test(line)) continue; |
| 114 | lines.push(line); | ||
| 115 | } | ||
| 116 | return lines; | ||
| 108 | } | 117 | } |
| 109 | 118 | ||
| 110 | export function firstSafeAuthLine(text: string): string | undefined { | 119 | export function firstSafeAuthLine(text: string): string | undefined { |