gabriel / muse public
fix patch task/branch-merged-commit-id #1 / 1
AI Agent gabriel · 13 days ago · Jul 5, 2026 · Diff

fix: muse branch --merged/--no-merged accept sha256: commit IDs

Previously crashed with a ValueError from validate_branch_name when the --merged/--no-merged argument was a commit ID rather than a branch name, since get_head_commit_id validates its input unconditionally as a branch name. Adds _resolve_into_tip() which recognizes a well-formed sha256: commit ID and uses it directly, falling back to the existing branch-name lookup otherwise.

Closes #21.

sha256:fcdc40f30b7dca01c5fb5e0a4e0665ef91185d23aaec91808101cc7845d6a475 sha
+18 ~1 symbols
2 changed · 1126 in snapshot files
sha256:9ed09ca6e27b3efa497c2ffc25ef84214b0814c809fb0190c866fcc136825a20 snapshot
+18
symbols added
~1
symbol modified
2
files changed
1126
files in snapshot
0
dead code introduced
Semantic Changes 19 symbols
~ tests/test_branch_merged_commit_id.py .py 15 symbols added
+ TestBranchMergedAcceptsCommitId class class TestBranchMergedAcceptsCommitId L53–107
+ test_merged_accepts_sha256_commit_id method method test_merged_accepts_sha256_commit_id L54–64
+ test_merged_still_accepts_branch_name method method test_merged_still_accepts_branch_name L79–88
+ test_merged_with_diverged_branch_by_commit_id method method test_merged_with_diverged_branch_by_commit_id L90–107
+ test_no_merged_accepts_sha256_commit_id method method test_no_merged_accepts_sha256_commit_id L66–77
+ _commit function function _commit L31–33
+ _head_commit_id function function _head_commit_id L36–38
+ _init_repo function function _init_repo L41–50
+ _invoke function function _invoke L22–28
+ CliRunner import import CliRunner L17–17
+ annotations import import annotations L11–11
+ json import import json L13–13
+ os import import os L14–14
+ pathlib import import pathlib L15–15
+ runner variable variable runner L19–19
~ muse/cli/commands/branch.py .py 3 symbols added, 1 symbol modified
+ _SHA256_FULL_RE variable variable _SHA256_FULL_RE L372–372
+ _resolve_into_tip function function _resolve_into_tip L375–388
+ re import import re L56–56
~ run
Files Changed
+1 ~1
1126 in snapshot
← Older Oldest on task/branch-merged-commit-id
All commits
Newer → Latest on task/branch-merged-commit-id

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:fcdc40f30b7dca01c5fb5e0a4e0665ef91185d23aaec91808101cc7845d6a475 --body "your comment"