summaryrefslogtreecommitdiffstats
path: root/tests/units/test_raw_internals.rb
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.(none)>2007-11-27 08:06:51 -0800
committerscott Chacon <schacon@agadorsparticus.(none)>2007-11-27 08:06:51 -0800
commit07ebb951368ed31bdaebc2e820c62ced22c8bbe4 (patch)
tree729d483ad8f66cf7907bedbb2d01dec6d2856654 /tests/units/test_raw_internals.rb
parent3fddf300bd33b356540bee50ae17590ea9b61341 (diff)
downloadthird_party-ruby-git-07ebb951368ed31bdaebc2e820c62ced22c8bbe4.zip
third_party-ruby-git-07ebb951368ed31bdaebc2e820c62ced22c8bbe4.tar.gz
third_party-ruby-git-07ebb951368ed31bdaebc2e820c62ced22c8bbe4.tar.xz
added Matthias and Simon to credits for the gitrb code
fixed an issue with raw object tree formatting added ls_tree implementation in raw git
Diffstat (limited to 'tests/units/test_raw_internals.rb')
-rw-r--r--tests/units/test_raw_internals.rb26
1 files changed, 20 insertions, 6 deletions
diff --git a/tests/units/test_raw_internals.rb b/tests/units/test_raw_internals.rb
index 1437845..03a7916 100644
--- a/tests/units/test_raw_internals.rb
+++ b/tests/units/test_raw_internals.rb
@@ -9,14 +9,16 @@ class TestRawInternals < Test::Unit::TestCase
end
def test_raw_log
- g = Git.bare(@wbare)
- t_log(g)
+ with_temp_bare do |g|
+ t_log(g)
+ end
end
def test_packed_log
- g = Git.bare(@wbare)
- g.repack
- t_log(g)
+ with_temp_bare do |g|
+ g.repack
+ t_log(g)
+ end
end
def test_commit_object
@@ -26,15 +28,27 @@ class TestRawInternals < Test::Unit::TestCase
assert_equal('test', c.message)
end
+ def test_lstree
+ g = Git.bare(@wbare)
+ c = g.object("v2.5").gtree
+ sha = c.sha
+
+ repo = Git::Raw::Repository.new(@wbare)
+ puts repo.object(sha).inspect
+ end
+
def t_log(g)
c = g.object("v2.5")
sha = c.sha
- repo = Git::Raw::Repository.new(@wbare)
+ repo = Git::Raw::Repository.new(g.repo.path)
raw_out = repo.log(sha)
assert_equal('commit 546bec6f8872efa41d5d97a369f669165ecda0de', raw_out.split("\n").first)
assert_equal('546bec6f8872efa41d5d97a369f669165ecda0de', c.log(30).first.sha)
end
+
+
+
end \ No newline at end of file