Permalink
Browse files

do not abbreviate revision numbers in Git

  • Loading branch information...
1 parent 0c65c9d commit 2c54d89e6340529d3200381e330c4a4592a549a4 @alexeyv alexeyv committed Dec 10, 2009
@@ -23,5 +23,9 @@ def inspect
"#{self.class}:(#{number})"
end
+ def label
+ self.number.to_s[0..7]
+ end
+
end
end
@@ -12,7 +12,7 @@ def parse(log)
case line
when /^commit /
revisions << revision = Revision.new
- revision.number = line.split[1][0..6]
+ revision.number = line.split[1]
when /^author /
revision.author, revision.time = read_author_and_time(line)
@@ -23,6 +23,11 @@ def to_s
description << "\n #{summary}" if summary
description << "\n"
end
+
+ def label
+ self.number.to_s[0..7]
+ end
+
end
end
end
View
@@ -73,7 +73,6 @@ def create_build_stub(label, status, time = Time.at(0))
build.stubs(:incomplete?).returns(status == 'incomplete')
build.stubs(:changeset).returns("bobby checked something in")
build.stubs(:brief_error).returns(nil)
-
build
end
@@ -43,7 +43,7 @@ class Git::LogParserTest < Test::Unit::TestCase
def test_parse_should_work
expected_revision = Git::Revision.new(
- :number => 'e51d66a',
+ :number => 'e51d66aa4f708fff1c87eb9afc9c48eaa8d5ffce',
:author => 'Alexey Verkhovsky <alexey.verkhovsky@gmail.com>',
:time => Time.at(1209921867))
revisions = Git::LogParser.new.parse(SIMPLE_LOG_ENTRY.split("\n"))
@@ -59,7 +59,7 @@ def test_should_split_into_separate_revisions
assert_equal 2, revisions.size
revision = revisions[1]
- assert_equal "5c881c8", revision.number
+ assert_equal "5c881c8da857dee2735349c5a36f1f525a347652", revision.number
assert_equal "renamed \"Unit Test\" target to \"UnitTest\" for developer sanity.\nfixed iphone cruise Rakefile",
revision.message
assert_equal ["iphone/Rakefile | 2 +-",
@@ -75,5 +75,6 @@ def test_parse_line_should_recognize_author
assert_equal 'Alexey Verkhovsky <alexey.verkhovsky@gmail.com>', author
assert_equal Time.at(1209921867), time
end
+
end
end

0 comments on commit 2c54d89

Please sign in to comment.