Class: GemContribute::Operations::Branch
- Inherits:
-
Object
- Object
- GemContribute::Operations::Branch
- Defined in:
- lib/gem_contribute/operations/branch.rb
Overview
Bootstrap step 3: create the per-issue working branch in the fork clone. The branch name is ‘gem-contribute/issue-<N>`. Output-free per ADR-0012.
Note: ‘git checkout -b` fails if the branch already exists, which surfaces as `Failure([:adapter_error, …])` here. That preserves the pre-extraction behaviour where re-running `fix` on an issue whose branch already exists locally errored out — see [#10] for the friendlier-message follow-up.
Defined Under Namespace
Classes: Result
Constant Summary collapse
- PREFIX =
"gem-contribute/issue-"
Instance Method Summary collapse
- #call(path:, issue:) ⇒ Object
-
#initialize(git: Git.new) ⇒ Branch
constructor
A new instance of Branch.
Constructor Details
Instance Method Details
#call(path:, issue:) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/gem_contribute/operations/branch.rb', line 26 def call(path:, issue:) name = "#{PREFIX}#{issue}" @git.checkout_branch(path, name) Success(Result.new(name: name)) rescue GemContribute::AdapterError => e Failure([:adapter_error, e.]) end |