feat: implement muse restore — working-tree and stage file restoration
Dedicated file restoration: --worktree (default) restores disk from stage or HEAD; --staged unstages (removes stage entry); --staged --worktree resets both. --source <ref> targets any commit or branch. Delegates object fetch to restore_object (inode-preserving, integrity-verified). 26 TDD tests: unit helpers, worktree/staged/both modes, --source, multi-path, dry-run, JSON, security (path traversal rejected), stress (100 files).
sha256:8e9d40a19ecb5debe9a28b776dee78555efe0be65c32d92a2ab1ed7b3e3dc2c2
sha
+82
~110
symbols
sha256:a079ae256f517a71793b6673d0e6f67dfbb92dc0a0598e0e5a30e6f9108e58bd
snapshot
+82
symbols added
~110
symbols modified
0
dead code introduced
Semantic Changes
192 symbols
+
test_resolve_file_path_traversal_raises
function
function test_resolve_file_path_traversal_raises L130–135
+
test_resolve_source_manifest_empty_repo
function
function test_resolve_source_manifest_empty_repo L115–120
+
test_resolve_source_manifest_from_head
function
function test_resolve_source_manifest_from_head L105–112
+
test_restore_dry_run_no_disk_change
function
function test_restore_dry_run_no_disk_change L365–373
+
test_restore_dry_run_no_stage_change
function
function test_restore_dry_run_no_stage_change L376–386
+
test_restore_file_not_in_head_exits_nonzero
function
function test_restore_file_not_in_head_exits_nonzero L199–203
+
test_restore_path_traversal_rejected
function
function test_restore_path_traversal_rejected L424–428
+
test_restore_source_file_not_in_that_commit_exits_nonzero
function
function test_restore_source_file_not_in_that_commit_exits_nonzero L332–338
+
test_restore_source_ref_not_found_exits_nonzero
function
function test_restore_source_ref_not_found_exits_nonzero L325–329
+
test_restore_source_ref_restores_from_commit
function
function test_restore_source_ref_restores_from_commit L309–322
+
test_restore_staged_does_not_touch_disk
function
function test_restore_staged_does_not_touch_disk L225–237
+
test_restore_staged_not_staged_is_noop
function
function test_restore_staged_not_staged_is_noop L272–277
+
test_restore_staged_path_traversal_rejected
function
function test_restore_staged_path_traversal_rejected L431–435
+
test_restore_staged_removes_added_file
function
function test_restore_staged_removes_added_file L240–256
+
test_restore_staged_removes_modification
function
function test_restore_staged_removes_modification L211–222
+
test_restore_staged_undeletes_from_stage
function
function test_restore_staged_undeletes_from_stage L259–269
+
test_restore_staged_worktree_resets_both
function
function test_restore_staged_worktree_resets_both L285–301
+
test_restore_worktree_does_not_touch_stage
function
function test_restore_worktree_does_not_touch_stage L155–172
+
test_restore_worktree_from_staged_content
function
function test_restore_worktree_from_staged_content L175–188
+
test_restore_worktree_overwrites_modified_file
function
function test_restore_worktree_overwrites_modified_file L143–152
~
age_cmd
~
annotate
~
archive
~
auth
~
bisect
~
blame
~
branch
~
breakage
~
bundle
~
cat
~
check
~
checkout
~
clean
~
clone
~
clones
~
codemap
~
commit
~
compare
~
contract
~
coord_gc
~
coupling
~
coverage
~
dag_cmd
~
dead
~
deps
~
describe
~
diff
~
docs_cmd
~
domains
~
entangle
~
fetch
~
forecast
~
gc
~
gravity
~
grep
~
harmony
~
hotspots
~
hub
~
impact
~
init
~
intent
~
lineage
~
log
~
merge
~
migrate
~
mv
~
patch
~
predict
~
pull
~
push
~
query
~
rebase
~
reflog
~
remote
~
rename
~
rerere
~
reserve
~
reset
~
revert
~
rm
~
shard
~
shortlog
~
show
~
stable
~
stash
~
status
~
switch
~
symbols
~
tag
~
test_cmd
~
trust
~
type_cmd
~
velocity
~
verify
~
worktree
~
main
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:8e9d40a19ecb5debe9a28b776dee78555efe0be65c32d92a2ab1ed7b3e3dc2c2 --body "your comment"
No comments yet. Be the first to start the discussion.