feat: add git branch support for worktree creation

Add optional branch configuration to specify which git branch to use
for worktree creation.

Features:
- New branch config option to specify base branch (e.g., main, develop)
- Each worktree creates a unique branch based on the specified branch
  (format: branch-run-id)
- If branch is not specified, uses the repository default branch
- Falls back gracefully when branch already exists

Changes:
- Add branch field to RunConfig dataclass
- Update GitWorktreeManager.create() to accept branch parameter
- Create unique branches for each worktree to avoid conflicts
- Update load_config() to parse branch from config
- Update config.example.json with branch option
- Update README.md documentation

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
tanzhenxin 2026-01-28 12:36:23 +08:00
parent 47a733362e
commit 66259aca29
3 changed files with 28 additions and 15 deletions

View file

@ -2,6 +2,7 @@
"concurrency": 3,
"yolo": true,
"source_repo": ".",
"branch": "main",
"worktree_base": "~/.qwen/worktrees",
"outputs_dir": "./outputs",
"results_file": "./results.json",