carson 3.10.0 → 3.10.1
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.
- checksums.yaml +4 -4
- data/RELEASE.md +6 -0
- data/VERSION +1 -1
- data/lib/carson/runtime/local/worktree.rb +12 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5e11a0b3de1e579e809455fca256a40882a226ae914e296cf0a670f0268c6ee3
|
|
4
|
+
data.tar.gz: 2b6bfb9124d69bec88912fae936d7394d1bb77a5e37fed2653e026fff14a531b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b2126c426ece435a94905532f7e7776cc873debb62aa57ba5267ec830a5995da330db79ebe28c5939835c1e15084132d60f0084abd7bee6e1d7780ec35fc288d
|
|
7
|
+
data.tar.gz: 5d4d9442043aa1abb923714ceabacae0edadba4b55b870a85cf2d0697364d92951299e86d85641202671ec0ceddd30407e52d8d2db8a65bd55782214ab45aa8f
|
data/RELEASE.md
CHANGED
|
@@ -5,6 +5,12 @@ Release-note scope rule:
|
|
|
5
5
|
- `RELEASE.md` records only version deltas, breaking changes, and migration actions.
|
|
6
6
|
- Operational usage guides live in `MANUAL.md` and `API.md`.
|
|
7
7
|
|
|
8
|
+
## 3.10.1
|
|
9
|
+
|
|
10
|
+
### What changed
|
|
11
|
+
|
|
12
|
+
- **CWD guard recovery points to main worktree** — the recovery command in the CWD safety block now uses `git rev-parse --git-common-dir` to find the main repository root, not the current worktree's root. Previously, when invoked from inside a worktree, the recovery command would `cd` back to the worktree itself instead of the main repo.
|
|
13
|
+
|
|
8
14
|
## 3.10.0 — CWD Safety Guard
|
|
9
15
|
|
|
10
16
|
### What changed
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.10.
|
|
1
|
+
3.10.1
|
|
@@ -136,10 +136,11 @@ module Carson
|
|
|
136
136
|
# Safety: refuse if the caller's shell CWD is inside the worktree.
|
|
137
137
|
# Removing a directory while a shell is inside it kills the shell permanently.
|
|
138
138
|
if cwd_inside_worktree?( worktree_path: resolved_path )
|
|
139
|
+
safe_root = main_worktree_root
|
|
139
140
|
return worktree_finish(
|
|
140
141
|
result: { command: "worktree remove", status: "block", name: File.basename( resolved_path ),
|
|
141
142
|
error: "current working directory is inside this worktree",
|
|
142
|
-
recovery: "cd #{
|
|
143
|
+
recovery: "cd #{safe_root} && carson worktree remove #{File.basename( resolved_path )}" },
|
|
143
144
|
exit_code: EXIT_BLOCK, json_output: json_output
|
|
144
145
|
)
|
|
145
146
|
end
|
|
@@ -257,6 +258,16 @@ module Carson
|
|
|
257
258
|
false
|
|
258
259
|
end
|
|
259
260
|
|
|
261
|
+
# Returns the main (non-worktree) repository root.
|
|
262
|
+
# Uses git-common-dir to find the shared .git directory, then takes its parent.
|
|
263
|
+
# Falls back to repo_root if detection fails.
|
|
264
|
+
def main_worktree_root
|
|
265
|
+
common_dir, _, success, = git_run( "rev-parse", "--path-format=absolute", "--git-common-dir" )
|
|
266
|
+
return File.dirname( common_dir.strip ) if success && !common_dir.strip.empty?
|
|
267
|
+
|
|
268
|
+
repo_root
|
|
269
|
+
end
|
|
270
|
+
|
|
260
271
|
# Resolves a worktree path: if it's a bare name, look under .claude/worktrees/.
|
|
261
272
|
def resolve_worktree_path( worktree_path: )
|
|
262
273
|
return File.expand_path( worktree_path ) if worktree_path.include?( "/" )
|