Class: Gitt::Commands::Branch
- Inherits:
-
Object
- Object
- Gitt::Commands::Branch
- Defined in:
- lib/gitt/commands/branch.rb
Overview
A Git branch command wrapper.
Instance Method Summary collapse
- #call(*arguments) ⇒ Object
- #default ⇒ Object
-
#initialize(shell: SHELL) ⇒ Branch
constructor
A new instance of Branch.
- #name ⇒ Object
Constructor Details
Instance Method Details
#call(*arguments) ⇒ Object
17 |
# File 'lib/gitt/commands/branch.rb', line 17 def call(*arguments) = shell.call "branch", *arguments |
#default ⇒ Object
11 12 13 14 15 |
# File 'lib/gitt/commands/branch.rb', line 11 def default shell.call("config", "init.defaultBranch") .fmap(&:chomp) .fmap { |name| name.empty? ? "main" : name } end |
#name ⇒ Object
19 |
# File 'lib/gitt/commands/branch.rb', line 19 def name = shell.call("rev-parse", "--abbrev-ref", "HEAD").fmap(&:chomp) |