Method: Bard::Git.current_branch
- Defined in:
- lib/bard/git.rb
.current_branch ⇒ Object
5 6 7 8 9 |
# File 'lib/bard/git.rb', line 5 def current_branch ref = `git symbolic-ref HEAD 2>&1`.chomp return false if ref =~ /^fatal:/ ref.sub(/refs\/heads\//, '') # refs/heads/master ... we want "master" end |