fixed git-worktree-create branch creation

This commit is contained in:
2026-05-17 12:22:24 +02:00
parent c3f8f9c611
commit 3fb88b1edc

View File

@@ -5,11 +5,9 @@ export default tool({
description: "Create a git worktree for a branch or PR",
args: {
branch: tool.schema.string().describe("Branch name or PR number"),
directory: tool.schema.string().describe("Worktree directory name (optional)"),
},
async execute(args) {
const worktreeDir = args.directory || args.branch
const result = await $`git worktree add ../worktrees/${worktreeDir} ${args.branch}`.text()
const result = await $`git worktree add ../worktrees/${args.branch}`.text()
return result.trim()
},
})