daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest May 19th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Repo
  2.    def head
  3.       Head.current(self)
  4.    end
  5. end
  6.  
  7. class Head < Ref
  8.  # Get the HEAD revision of the repo.
  9.  #   +repo+ is the Repo
  10.  #   +options+ is a Hash of options
  11.  #
  12.  # Returns Grit::Head (baked)
  13.  def self.current(repo, options = {})
  14.    head = repo.git.fs_read('HEAD').chomp
  15.    if /ref: refs\/heads\/(.*)/.match(head)
  16.      self.new($1, repo.git.rev_parse(options, 'HEAD'))
  17.    end
  18.  end
  19. end # Head
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top