@vibedeckx/linux-x64 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +13 -4
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -207242,6 +207242,13 @@ function parseGitWorktreeList(projectPath) {
|
|
|
207242
207242
|
worktreeListCache.set(projectPath, { entries, expiresAt: now3 + WORKTREE_LIST_TTL_MS });
|
|
207243
207243
|
return entries;
|
|
207244
207244
|
}
|
|
207245
|
+
function readWorktreeListTolerant(projectPath) {
|
|
207246
|
+
try {
|
|
207247
|
+
return parseGitWorktreeList(projectPath);
|
|
207248
|
+
} catch {
|
|
207249
|
+
return [{ path: projectPath, branch: null }];
|
|
207250
|
+
}
|
|
207251
|
+
}
|
|
207245
207252
|
function pruneWorktrees(projectPath) {
|
|
207246
207253
|
try {
|
|
207247
207254
|
execSync("git worktree prune", {
|
|
@@ -207249,6 +207256,7 @@ function pruneWorktrees(projectPath) {
|
|
|
207249
207256
|
encoding: "utf-8",
|
|
207250
207257
|
stdio: ["pipe", "pipe", "pipe"]
|
|
207251
207258
|
});
|
|
207259
|
+
} catch {
|
|
207252
207260
|
} finally {
|
|
207253
207261
|
worktreeListCache.delete(projectPath);
|
|
207254
207262
|
}
|
|
@@ -207288,7 +207296,8 @@ function reconcileWorktreeBranches(projectPath, entries, sessionBranches = [], r
|
|
|
207288
207296
|
}
|
|
207289
207297
|
const rootEntry = entries[0];
|
|
207290
207298
|
const rootAnchor = rootEntry ? registryByPath.get(path6.resolve(rootEntry.path)) : void 0;
|
|
207291
|
-
const
|
|
207299
|
+
const rootDrifted = Boolean(rootAnchor) && rootEntry?.branch != null && rootEntry.branch !== rootAnchor.expectedBranch;
|
|
207300
|
+
const worktrees = [rootDrifted ? { branch: null, currentBranch: rootEntry?.branch ?? null } : { branch: null }];
|
|
207292
207301
|
for (let i = 1; i < entries.length; i++) {
|
|
207293
207302
|
const entry = entries[i];
|
|
207294
207303
|
const anchor = registryByPath.get(path6.resolve(entry.path));
|
|
@@ -207303,7 +207312,7 @@ function reconcileWorktreeBranches(projectPath, entries, sessionBranches = [], r
|
|
|
207303
207312
|
return worktrees;
|
|
207304
207313
|
}
|
|
207305
207314
|
async function getRegisteredWorktreeBranches(storage, projectId, projectPath) {
|
|
207306
|
-
const entries =
|
|
207315
|
+
const entries = readWorktreeListTolerant(projectPath);
|
|
207307
207316
|
const sessions = await storage.agentSessions.getProjectedByProjectId(projectId, "runtime");
|
|
207308
207317
|
const sessionBranches = sessions.map((session) => session.branch);
|
|
207309
207318
|
const sessionBranchByPath = /* @__PURE__ */ new Map();
|
|
@@ -207337,14 +207346,14 @@ async function getRegisteredWorktreeBranches(storage, projectId, projectPath) {
|
|
|
207337
207346
|
}
|
|
207338
207347
|
continue;
|
|
207339
207348
|
}
|
|
207340
|
-
if (registeredPaths.has(resolvedPath) || entry.branch === null) continue;
|
|
207349
|
+
if (registeredPaths.has(resolvedPath) || entry.branch === null && index > 0) continue;
|
|
207341
207350
|
const stableBranch = index === 0 ? "" : sessionBranchByPath.get(resolvedPath) ?? entry.branch;
|
|
207342
207351
|
await storage.workspaceRegistry.registerReadyCheckout({
|
|
207343
207352
|
projectId,
|
|
207344
207353
|
branch: stableBranch,
|
|
207345
207354
|
targetId: "local",
|
|
207346
207355
|
worktreePath: entry.path,
|
|
207347
|
-
expectedBranch: index === 0 ? entry.branch : stableBranch
|
|
207356
|
+
expectedBranch: index === 0 ? entry.branch ?? "" : stableBranch
|
|
207348
207357
|
});
|
|
207349
207358
|
registeredPaths.add(resolvedPath);
|
|
207350
207359
|
}
|