gabriel / muse public
test branch task/supercharge-branch #1 / 1
AI Agent gabriel · 163 days ago · Apr 16, 2026 · Diff

test(branch): supercharge — 70 new tests, fix stale _ZERO_OID format

- Fix _ZERO_OID in test_security_branch_ref_injection: 64-hex → sha256:<64-hex> (write_branch_ref now requires sha256:-prefix format; 3 tests were broken)

- Add test_cmd_branch_supercharged (70 tests) covering gaps: * committed_at field in --json schema (baseline missed this field entirely) * --sort committeddate actual ordering (baseline only checked exit 0) * -r / -a remote-tracking listing E2E with real .muse/remotes/ structure * -dr success path + JSON schema (only error paths were tested before) * -vv upstream shown in [brackets] in text output * Diamond-merge DAG: --merged with two-parent merge commits * _ref_file, _cleanup_empty_dirs unit tests (nested dir cleanup) * _list_remotes unit tests (hidden files, nested branches, sort) * Empty parent dirs cleaned after nested branch delete (E2E) * Rename into nested path creates intermediate dirs * Force-rename/copy preserves tip, src integrity * JSON error schemas: error + message + hint fields for all mutation ops * create --json: commit_id has sha256: prefix, from field present/null * Security: ANSI injection in --merged / --no-merged / --contains * Performance: --sort committeddate with 50 branches under 3s * Docstring coverage for all 10 public helpers

sha256:7fbf1a30a27c42d1be7c170fab25d948ef2caa0bc7d67813e5d57f1e733fcd29 sha
+105 ~1 symbols
sha256:e4f4ce875bb1a9ea39df0065b114ce3ab0f39a4f1f97076b66de2978474df5ec snapshot
+105
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 106 symbols
~ tests/test_cmd_branch_supercharged.py .py 105 symbols added
+ TestCleanupEmptyDirs class class TestCleanupEmptyDirs L135–178
+ test_leaves_non_empty_parent method method test_leaves_non_empty_parent L156–168
+ test_removes_empty_parent_dir method method test_removes_empty_parent_dir L136–144
+ test_removes_multiple_levels method method test_removes_multiple_levels L170–178
+ test_stops_at_heads_dir method method test_stops_at_heads_dir L146–154
+ TestCreateJsonSchema class class TestCreateJsonSchema L651–677
+ test_create_commit_id_is_sha256_prefixed method method test_create_commit_id_is_sha256_prefixed L661–666
+ test_create_from_is_null_when_no_start_point method method test_create_from_is_null_when_no_start_point L668–671
+ test_create_from_set_when_start_point_given method method test_create_from_set_when_start_point_given L673–677
+ test_create_json_schema_complete method method test_create_json_schema_complete L652–659
+ TestDataIntegrityNested class class TestDataIntegrityNested L531–582
+ test_delete_nested_cleans_parent_dirs method method test_delete_nested_cleans_parent_dirs L532–540
+ test_delete_nested_keeps_sibling_dir method method test_delete_nested_keeps_sibling_dir L542–548
+ test_force_copy_preserves_src_tip method method test_force_copy_preserves_src_tip L567–576
+ test_force_rename_preserves_tip method method test_force_rename_preserves_tip L558–565
+ test_rename_current_branch_updates_head method method test_rename_current_branch_updates_head L578–582
+ test_rename_into_nested_path_creates_dirs method method test_rename_into_nested_path_creates_dirs L550–556
+ TestDiamondMergeDag class class TestDiamondMergeDag L470–523
+ test_merged_branch_included_after_diamond_merge method method test_merged_branch_included_after_diamond_merge L473–499
+ test_unmerged_sibling_excluded_from_diamond method method test_unmerged_sibling_excluded_from_diamond L501–523
+ TestDocstrings class class TestDocstrings L736–784
+ _has_doc method method _has_doc L737–740
+ test_cleanup_empty_dirs_docstring method method test_cleanup_empty_dirs_docstring L774–776
+ test_commit_ancestors_docstring method method test_commit_ancestors_docstring L762–764
+ test_contains_commit_docstring method method test_contains_commit_docstring L770–772
+ test_is_merged_docstring method method test_is_merged_docstring L766–768
+ test_list_local_branches_docstring method method test_list_local_branches_docstring L750–752
+ test_list_remotes_docstring method method test_list_remotes_docstring L754–756
+ test_module_docstring method method test_module_docstring L742–744
+ test_ref_file_docstring method method test_ref_file_docstring L746–748
+ test_resolve_start_point_docstring method method test_resolve_start_point_docstring L778–780
+ test_run_docstring method method test_run_docstring L782–784
+ test_upstream_for_docstring method method test_upstream_for_docstring L758–760
+ TestJsonErrorSchemas class class TestJsonErrorSchemas L590–643
+ test_copy_not_found_json_schema method method test_copy_not_found_json_schema L633–637
+ test_create_already_exists_json_schema method method test_create_already_exists_json_schema L639–643
+ test_delete_current_branch_json_schema method method test_delete_current_branch_json_schema L612–616
+ test_delete_not_found_json_schema method method test_delete_not_found_json_schema L593–598
+ test_delete_not_merged_json_schema method method test_delete_not_merged_json_schema L600–610
+ test_rename_already_exists_json_schema method method test_rename_already_exists_json_schema L624–631
+ test_rename_not_found_json_schema method method test_rename_not_found_json_schema L618–622
+ TestListJsonCommittedAt class class TestListJsonCommittedAt L232–270
+ test_committed_at_is_iso8601 method method test_committed_at_is_iso8601 L243–251
+ test_committed_at_null_for_empty_branch method method test_committed_at_null_for_empty_branch L253–262
+ test_committed_at_present_in_schema method method test_committed_at_present_in_schema L235–241
+ test_committed_at_schema_complete method method test_committed_at_schema_complete L264–270
+ TestListRemotes class class TestListRemotes L186–224
+ test_empty_when_no_remotes_dir method method test_empty_when_no_remotes_dir L187–190
+ test_lists_nested_remote_branch method method test_lists_nested_remote_branch L200–206
+ test_lists_single_remote method method test_lists_single_remote L192–198
+ test_skips_hidden_files method method test_skips_hidden_files L208–215
+ test_sorted_output method method test_sorted_output L217–224
+ TestRefFile class class TestRefFile L113–127
+ test_nested_branch method method test_nested_branch L119–122
+ test_returns_pathlib_path method method test_returns_pathlib_path L124–127
+ test_simple_branch method method test_simple_branch L114–117
+ TestRemoteTrackingBranches class class TestRemoteTrackingBranches L327–423
+ test_dr_deletes_remote_tracking_ref method method test_dr_deletes_remote_tracking_ref L387–398
+ test_dr_json_schema method method test_dr_json_schema L400–408
+ test_dr_no_slash_exits_1 method method test_dr_no_slash_exits_1 L421–423
+ test_dr_nonexistent_exits_1 method method test_dr_nonexistent_exits_1 L417–419
+ test_dr_remotes_prefix_accepted method method test_dr_remotes_prefix_accepted L410–415
+ test_list_a_includes_both method method test_list_a_includes_both L350–360
+ test_list_a_sorted_by_name method method test_list_a_sorted_by_name L375–385
+ test_list_r_empty_when_no_remotes method method test_list_r_empty_when_no_remotes L362–365
+ test_list_r_excludes_local_branches method method test_list_r_excludes_local_branches L341–348
+ test_list_r_nested_remote_branch method method test_list_r_nested_remote_branch L367–373
+ test_list_r_shows_only_remotes method method test_list_r_shows_only_remotes L328–339
+ TestSecurityFilterFlags class class TestSecurityFilterFlags L685–708
+ _has_ansi method method _has_ansi L686–687
+ test_ansi_in_contains_ref method method test_ansi_in_contains_ref L697–699
+ test_ansi_in_delete_json_error_sanitized method method test_ansi_in_delete_json_error_sanitized L705–708
+ test_ansi_in_merged_ref_rejected_or_sanitized method method test_ansi_in_merged_ref_rejected_or_sanitized L689–691
+ test_ansi_in_no_merged_ref method method test_ansi_in_no_merged_ref L693–695
+ test_newline_in_branch_name_rejected method method test_newline_in_branch_name_rejected L701–703
+ TestSortCommittedDateOrdering class class TestSortCommittedDateOrdering L278–319
+ test_empty_branches_sorted_last method method test_empty_branches_sorted_last L305–319
+ test_newer_branch_first method method test_newer_branch_first L281–294
+ test_timestamp_order_consistent_on_ties method method test_timestamp_order_consistent_on_ties L296–303
+ TestSortCommittedDatePerformance class class TestSortCommittedDatePerformance L716–728
+ test_50_branches_committeddate_under_3s method method test_50_branches_committeddate_under_3s L717–728
+ TestVerboseUpstream class class TestVerboseUpstream L431–462
+ _set_upstream method method _set_upstream L432–441
+ test_v_does_not_show_upstream method method test_v_does_not_show_upstream L454–458
+ test_vv_no_upstream_no_brackets method method test_vv_no_upstream_no_brackets L460–462
+ test_vv_shows_upstream method method test_vv_shows_upstream L443–447
+ test_vv_upstream_in_brackets method method test_vv_upstream_in_brackets L449–452
+ _branch function function _branch L60–61
+ _commit function function _commit L64–65
+ _first_json function function _first_json L89–95
+ _invoke function function _invoke L51–57
+ _make_remote_ref function function _make_remote_ref L98–105
+ CliRunner import import CliRunner L40–40
+ InvokeResult import import InvokeResult L40–40
+ annotations import import annotations L31–31
+ get_head_commit_id import import get_head_commit_id L41–41
+ json import import json L33–33
+ os import import os L34–34
+ pathlib import import pathlib L35–35
+ pytest import import pytest L38–38
+ read_current_branch import import read_current_branch L41–41
+ time import import time L36–36
+ repo function function repo L69–79
+ runner variable variable runner L43–43
+ two_commit_repo function function two_commit_repo L83–86
← Older Oldest on task/supercharge-branch
All commits
Newer → Latest on task/supercharge-branch

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