Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: parse quoted git status paths (#12573)

[._.]/ Adam Eivyeb7412c67adb
diff --git a/server/services/worktreeManager.js b/server/services/worktreeManager.js
index 8002899ddf..c2d2f7c9a4 100644
--- a/server/services/worktreeManager.js
+++ b/server/services/worktreeManager.js
@@ -541,7 +541,9 @@ export function classifyWorktreeDirt(porcelain, { ignoredPaths = [] } = {}) {
for (let i = 1; i < path.length - 1; i += 1) {
const char = path[i];
if (char !== '\\') {
- bytes.push(...Buffer.from(char));
+ const codePoint = String.fromCodePoint(path.codePointAt(i));
+ bytes.push(...Buffer.from(codePoint));
+ i += codePoint.length - 1;
continue;
}
const escaped = path[++i];
diff --git a/server/services/worktreeManager.test.js b/server/services/worktreeManager.test.js
index 7ca9edba1d..6d5e10ea9f 100644
--- a/server/services/worktreeManager.test.js
+++ b/server/services/worktreeManager.test.js
@@ -240,6 +240,8 @@ describe('classifyWorktreeDirt (real exported helper)', () => {
const lockfile = classifyWorktreeDirt(' M "my app/package-lock.json"\n');
expect(lockfile.lockfileOnly).toBe(true);
expect(lockfile.lockfilePaths).toEqual(['my app/package-lock.json']);
+ const emojiPath = classifyWorktreeDirt(' M "my 😀 app/package-lock.json"');
+ expect(emojiPath.lockfilePaths).toEqual(['my 😀 app/package-lock.json']);
expect(classifyWorktreeDirt('?? ".portos-public-review/"').clean).toBe(true);
expect(classifyWorktreeDirt('?? "PORTOS_PUBLIC_REVIEW_INPUT.json"').clean).toBe(true);