clawt 2.3.2 → 2.3.3

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/index.js CHANGED
@@ -1037,8 +1037,16 @@ function migrateChangesViaPatch(targetWorktreePath, mainWorktreePath, branchName
1037
1037
  }
1038
1038
  } finally {
1039
1039
  if (didTempCommit) {
1040
- gitResetSoft(1, targetWorktreePath);
1041
- gitRestoreStaged(targetWorktreePath);
1040
+ try {
1041
+ gitResetSoft(1, targetWorktreePath);
1042
+ } catch (error) {
1043
+ logger.error(`\u64A4\u9500\u4E34\u65F6 commit \u5931\u8D25: ${error}`);
1044
+ }
1045
+ try {
1046
+ gitRestoreStaged(targetWorktreePath);
1047
+ } catch (error) {
1048
+ logger.error(`\u6062\u590D\u6682\u5B58\u533A\u5931\u8D25: ${error}`);
1049
+ }
1042
1050
  }
1043
1051
  }
1044
1052
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawt",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "本地并行执行多个Claude Code Agent任务,融合 Git Worktree 与 Claude Code CLI 的命令行工具",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -127,9 +127,18 @@ function migrateChangesViaPatch(targetWorktreePath: string, mainWorktreePath: st
127
127
  }
128
128
  } finally {
129
129
  // 确保临时 commit 一定会被撤销,恢复目标 worktree 原状
130
+ // 每个操作独立 try-catch,避免前一个失败导致后续操作不执行
130
131
  if (didTempCommit) {
131
- gitResetSoft(1, targetWorktreePath);
132
- gitRestoreStaged(targetWorktreePath);
132
+ try {
133
+ gitResetSoft(1, targetWorktreePath);
134
+ } catch (error) {
135
+ logger.error(`撤销临时 commit 失败: ${error}`);
136
+ }
137
+ try {
138
+ gitRestoreStaged(targetWorktreePath);
139
+ } catch (error) {
140
+ logger.error(`恢复暂存区失败: ${error}`);
141
+ }
133
142
  }
134
143
  }
135
144
  }