Pretty object inspection
# File lib/grit/ref.rb, line 43 def inspect %Q{#<#{self.class.name} "#{@name}">} end
Find all Refs
+repo+ is the Repo +options+ is a Hash of options
Returns Grit::Ref[] (baked)
# File lib/grit/ref.rb, line 12 def find_all(repo, options = {}) refs = repo.git.refs(options, prefix) refs.split("\n").map do |ref| name, id = *ref.split(' ') commit = Commit.create(repo, :id => id) self.new(name, commit) end end
Instantiate a new Head
+name+ is the name of the head +commit+ is the Commit that the head points to
Returns Grit::Head (baked)
# File lib/grit/ref.rb, line 37 def initialize(name, commit) @name = name @commit = commit end
# File lib/grit/ref.rb, line 23 def prefix "refs/#{name.to_s.gsub(/^.*::/, '').downcase}s" end