You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Define HeadState as Data.define(:state, :name) in Git::Repository::Branching
and add a #current_branch_state facade method that returns it. The three
possible HEAD states are:
- :active -- branch ref with at least one commit
- :unborn -- branch ref that exists but has no commits yet
- :detached -- HEAD points directly to a commit SHA
A private helper, Private.get_branch_state, mirrors the Git::Lib implementation
but takes execution_context as an explicit argument rather than relying on self.
Git::Base#current_branch_state delegates to the facade.
Also updates UPGRADING.md with a migration row and a callout about the return-
type change (mutable Struct to immutable Data object), and marks the row in
redesign/c1c2_audit.md §7.3 as promoted (§7.5 promote count decremented from
2 to 1).
Task commits included:
- feat(branching): add Git::Repository::Branching#current_branch_state facade
- docs: update UPGRADING.md and c1c2_audit.md for current_branch_state
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: redesign/c1c2_audit.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -411,7 +411,7 @@ These require a new facade method before a base.rb delegator can be added.
411
411
|`parse_config(file)`| Parses a config file from path. | 🔍 human decision — expose or fold into `config()` with `:file` option? |
412
412
|`stash_list`| Returns a formatted string `"stash@{0}: ...\n..."` — distinct from `stashes_all` which returns structured data. | 🔍 human decision — promote for backward compat, or deprecate in favor of `stashes_all`? |
413
413
|`unmerged`| Returns paths with unresolved merge conflicts. Already partially covered by `each_conflict` (yields paths to temporary files for staged content). Pure path list is useful. | 🔍 human decision — promote `unmerged` as a simpler alternative to `each_conflict`? |
414
-
|`current_branch_state`| Returns a `HeadState`struct with `:state` (`:active`/`:unborn`/`:detached`) and `:name`. Richer than `current_branch`. | ⬜ promote — add to `Git::Repository::Branching`; trivial effort (command class already wired in lib.rb) |
414
+
|`current_branch_state`| Returns a `HeadState`value object with `:state` (`:active`/`:unborn`/`:detached`) and `:name`. Richer than `current_branch`. Legacy `Git::Lib` implementation used a mutable `Struct`; promoted facade uses an immutable `Data` object. | ✅ promoted — `HeadState` Data object defined in `Git::Repository::Branching`; facade in `Git::Repository::Branching` + `Git::Base` delegator added (PR 5g) |
415
415
416
416
### 7.4 Internal Plumbing — Mark as ❌ Remove
417
417
@@ -439,7 +439,7 @@ upgrade notes as "unsupported; remove any `g.lib.X` calls."
439
439
| Status | Count |
440
440
|--------|-------|
441
441
| ✅ promote (repo already had it, `Git::Base` delegator added — PR 2d; or alias added) | 24 |
0 commit comments