0
@@ -8,53 +8,53 @@ module Grit
0
# +name+ is the name of the head
0
# +commit+ is the Commit that the head points to
0
- # Returns Grit::
Head (baked)
0
+ # Returns Grit::
Tag (baked)
0
def initialize(name, commit)
0
# +options+ is a Hash of options
0
- # Returns Grit::
Head[] (baked)
0
+ # Returns Grit::
Tag[] (baked)
0
def self.find_all(repo, options = {})
0
default_options = {:sort => "committerdate",
0
- :format => "
'%(refname)%00%(objectname)'"}
0
+ :format => "
%(refname)%00%(objectname)"}
0
actual_options = default_options.merge(options)
0
- output = repo.git.for_each_ref(actual_options, "refs/
heads")
0
+ output = repo.git.for_each_ref(actual_options, "refs/
tags")
0
-
Head.list_from_string(repo, output)
0
+
self.list_from_string(repo, output)
0
- # Parse out
head information into an array of baked head objects
0
+ # Parse out
tag information into an array of baked Tag objects
0
# +text+ is the text output from the git command
0
- # Returns Grit::
Head[] (baked)
0
+ # Returns Grit::
Tag[] (baked)
0
def self.list_from_string(repo, text)
0
text.split("\n").each do |line|
0
-
heads << self.from_string(repo, line)
0
+
tags << self.from_string(repo, line)
0
- # Create a new
Head instance from the given string.
0
+ # Create a new
Tag instance from the given string.
0
- # +line+ is the formatted
head information
0
+ # +line+ is the formatted
tag information
0
- # Returns Grit::
Head (baked)
0
+ # Returns Grit::
Tag (baked)
0
def self.from_string(repo, line)
0
full_name, id = line.split("\0")
0
name = full_name.split("/").last
0
@@ -64,8 +64,8 @@ module Grit
0
# Pretty object inspection
0
- %Q{#<Grit::
Head "#{@name}">}
0
+ %Q{#<Grit::
Tag "#{@name}">}
0
\ No newline at end of file
Comments
No one has commented yet.