Class: EacGit::Local::Branch

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_git/local/branch.rb

Constant Summary collapse

REFS_PREFIX =
'refs/heads/'

Instance Method Summary collapse

Instance Method Details

#current_commit_idString

Returns:

  • (String)


13
14
15
# File 'lib/eac_git/local/branch.rb', line 13

def current_commit_id
  local.rev_parse(full_ref_name, true)
end

#exist?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/eac_git/local/branch.rb', line 18

def exist?
  local.command('show-ref', '--quiet', full_ref_name).execute.fetch(:exit_code).zero?
end

#full_ref_nameObject



22
23
24
# File 'lib/eac_git/local/branch.rb', line 22

def full_ref_name
  "#{REFS_PREFIX}#{name}"
end