mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
chore: remove worktree integration E2E test file
- Deleted the worktree integration test file to streamline the test suite and remove obsolete tests. This change helps maintain focus on relevant test cases and improves overall test management.
This commit is contained in:
@@ -74,23 +74,8 @@ export function createListHandler() {
|
||||
} else if (line.startsWith('branch ')) {
|
||||
current.branch = line.slice(7).replace('refs/heads/', '');
|
||||
} else if (line === '') {
|
||||
if (current.path) {
|
||||
if (current.path && current.branch) {
|
||||
const isMainWorktree = isFirst;
|
||||
|
||||
// If branch is missing (can happen for main worktree in some git states),
|
||||
// fall back to getCurrentBranch() for the main worktree
|
||||
let branchName = current.branch;
|
||||
if (!branchName && isMainWorktree) {
|
||||
// For main worktree, use the current branch we already fetched
|
||||
branchName = currentBranch || '';
|
||||
}
|
||||
|
||||
// Skip if we still don't have a branch name (shouldn't happen, but be safe)
|
||||
if (!branchName) {
|
||||
current = {};
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if the worktree directory actually exists
|
||||
// Skip checking/pruning the main worktree (projectPath itself)
|
||||
let worktreeExists = false;
|
||||
@@ -104,15 +89,15 @@ export function createListHandler() {
|
||||
// Worktree directory doesn't exist - it was manually deleted
|
||||
removedWorktrees.push({
|
||||
path: current.path,
|
||||
branch: branchName,
|
||||
branch: current.branch,
|
||||
});
|
||||
} else {
|
||||
// Worktree exists (or is main worktree), add it to the list
|
||||
worktrees.push({
|
||||
path: current.path,
|
||||
branch: branchName,
|
||||
branch: current.branch,
|
||||
isMain: isMainWorktree,
|
||||
isCurrent: branchName === currentBranch,
|
||||
isCurrent: current.branch === currentBranch,
|
||||
hasWorktree: true,
|
||||
});
|
||||
isFirst = false;
|
||||
@@ -122,48 +107,6 @@ export function createListHandler() {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the last worktree entry if output doesn't end with blank line
|
||||
if (current.path) {
|
||||
const isMainWorktree = isFirst;
|
||||
|
||||
// If branch is missing (can happen for main worktree in some git states),
|
||||
// fall back to getCurrentBranch() for the main worktree
|
||||
let branchName = current.branch;
|
||||
if (!branchName && isMainWorktree) {
|
||||
// For main worktree, use the current branch we already fetched
|
||||
branchName = currentBranch || '';
|
||||
}
|
||||
|
||||
// Only add if we have a branch name
|
||||
if (branchName) {
|
||||
// Check if the worktree directory actually exists
|
||||
// Skip checking/pruning the main worktree (projectPath itself)
|
||||
let worktreeExists = false;
|
||||
try {
|
||||
await secureFs.access(current.path);
|
||||
worktreeExists = true;
|
||||
} catch {
|
||||
worktreeExists = false;
|
||||
}
|
||||
if (!isMainWorktree && !worktreeExists) {
|
||||
// Worktree directory doesn't exist - it was manually deleted
|
||||
removedWorktrees.push({
|
||||
path: current.path,
|
||||
branch: branchName,
|
||||
});
|
||||
} else {
|
||||
// Worktree exists (or is main worktree), add it to the list
|
||||
worktrees.push({
|
||||
path: current.path,
|
||||
branch: branchName,
|
||||
isMain: isMainWorktree,
|
||||
isCurrent: branchName === currentBranch,
|
||||
hasWorktree: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Prune removed worktrees from git (only if any were detected)
|
||||
if (removedWorktrees.length > 0) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user