Module: BranchCommon

Included in:
Branch, DetachBranch
Defined in:
lib/git/stash/sclib/branch.rb

Defined Under Namespace

Modules: CommitMode

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



40
41
42
# File 'lib/git/stash/sclib/branch.rb', line 40

def name
  @name
end

Instance Method Details

#cherryPickNoCommit(target) ⇒ Object



44
45
46
47
48
# File 'lib/git/stash/sclib/branch.rb', line 44

def cherryPickNoCommit(target)
  checkout
  puts "[#{@name}]: git cherry-pick --no-commit \"#{target}\""
  Cmd::exec "git cherry-pick --no-commit \"#{target}\""
end

#initialize(name, maketarget = '') ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/git/stash/sclib/branch.rb', line 29

def initialize(name, maketarget='')
  @name = name
  if exist?
    # no-op
  elsif maketarget != ''
    make maketarget
  else
    raise 'Branch instanced failed'
  end
end