@alpacachen/dsh-simple-worktree 1.0.12 → 1.0.13

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/client/client.js CHANGED
@@ -97,7 +97,8 @@ window.__ModuleLoader__.load({
97
97
  .dswt-new-session-button svg { width: 14px; height: 14px; }
98
98
  .dswt-spin { animation: dswt-spin 1s linear infinite; }
99
99
  @keyframes dswt-spin { to { transform: rotate(360deg); } }
100
- .dswt-error { display: flex; align-items: flex-start; gap: 6px; margin-top: 14px; border-radius: 8px; padding: 8px 10px; color: var(--dsw-alias-state-error-primary, #b42318); background: var(--dsw-alias-state-error-secondary, #fff1f0); font-size: 12px; line-height: 18px; }
100
+ .dswt-error { display: flex; align-items: flex-start; gap: 7px; box-sizing: border-box; max-width: 100%; margin-top: 14px; border: 1px solid color-mix(in srgb, var(--dsw-alias-state-error-primary, #b42318) 24%, transparent); border-radius: 8px; padding: 9px 11px; color: var(--dsw-alias-state-error-primary, #b42318); background: color-mix(in srgb, var(--dsw-alias-state-error-primary, #b42318) 9%, var(--dsw-alias-bg-layer-1, #fff)); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
101
+ .dswt-error svg { flex: none; margin-top: 2px; }
101
102
  .dswt-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
102
103
  .dswt-settings { color: var(--dsw-alias-label-primary, #111); font-size: 13px; }
103
104
  .dswt-settings-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
package/lib/index.js CHANGED
@@ -229,7 +229,11 @@ export function apply(ctx) {
229
229
  const branch = typeof payload.branch === 'string' ? payload.branch.trim() : ''
230
230
  const baseRef = typeof payload.baseRef === 'string' && payload.baseRef.trim() ? payload.baseRef.trim() : 'HEAD'
231
231
  if (!repoPath || !path || !branch) throw new Error('任务名称、工作目录和分支不能为空。')
232
- await runGit(ctx.subprocess, repoPath, ['worktree', 'add', '-b', branch, path, baseRef])
232
+ const branchRef = await tryRunGit(ctx.subprocess, repoPath, ['show-ref', '--verify', '--quiet', `refs/heads/${branch}`])
233
+ const args = branchRef
234
+ ? ['worktree', 'add', path, branch]
235
+ : ['worktree', 'add', '-b', branch, path, baseRef]
236
+ await runGit(ctx.subprocess, repoPath, args)
233
237
  return { path, branch, baseRef }
234
238
  })
235
239
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpacachen/dsh-simple-worktree",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "A Git worktree plugin for DeepSeek Harness that creates task branches, registers worktrees as DSH Workspaces, and opens isolated sessions.",
5
5
  "license": "MIT",
6
6
  "keywords": [