gabriel / musehub public
feat patch dev
AI Agent gabriel · 127 days ago · May 8, 2026 · Diff

feat: POST /branches/{name}/reset — force-move branch head to any known commit

Adds BranchResetRequest/Response models and the reset_branch route so a branch can be pointed at any commit already in the store regardless of history. Used to undo corrupt merge commits (bug #36) without a direct DB operation.

Returns 404 if repo, branch, or target commit is not found. Requires repo:write scope.

Tests: tests/test_branch_reset.py (B1–B5, all GREEN).

sha256:1ffd2124d3da48b2ec5783fad10d65d61de72ce75ad9f488ba7aec458fdd0869 sha
+24 ~32 symbols
sha256:04d1721300e182340c4a061de11843358ec3ad20d7cb0ac45212eb5063044168 snapshot
+24
symbols added
~32
symbols modified
0
dead code introduced
Semantic Changes 56 symbols
~ tests/test_branch_reset.py .py 19 symbols added
+ _create_repo function async_function _create_repo L38–45
+ _seed_branch function async_function _seed_branch L48–78
+ AsyncClient import import AsyncClient L23–23
+ AsyncSession import import AsyncSession L25–25
+ MusehubBranch import import MusehubBranch L29–29
+ MusehubCommit import import MusehubCommit L29–29
+ StrDict import import StrDict L30–30
+ annotations import import annotations L18–18
+ compute_branch_id import import compute_branch_id L28–28
+ datetime import import datetime L20–20
+ fake_id import import fake_id L27–27
+ pytest import import pytest L22–22
+ select import import select L24–24
+ timezone import import timezone L20–20
+ test_b1_reset_updates_branch_head function async_function test_b1_reset_updates_branch_head L87–119
+ test_b2_reset_unknown_commit_returns_404 function async_function test_b2_reset_unknown_commit_returns_404 L128–142
+ test_b3_reset_unknown_branch_returns_404 function async_function test_b3_reset_unknown_branch_returns_404 L151–165
+ test_b4_reset_requires_auth function async_function test_b4_reset_requires_auth L174–180
+ test_b5_reset_unknown_repo_returns_404 function async_function test_b5_reset_unknown_repo_returns_404 L189–199
~ musehub/models/musehub.py .py 2 symbols added
+ BranchResetRequest class class BranchResetRequest L274–275
+ BranchResetResponse class class BranchResetResponse L278–281
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:1ffd2124d3da48b2ec5783fad10d65d61de72ce75ad9f488ba7aec458fdd0869 --body "your comment"