gitrb 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/gitrb.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'gitrb'
3
- s.version = '0.2.2'
3
+ s.version = '0.2.3'
4
4
  s.summary = 'Pure ruby git implementation'
5
5
  s.author = 'Daniel Mendler'
6
6
  s.email = 'mail@daniel-mendler.de'
data/lib/gitrb/tree.rb CHANGED
@@ -73,7 +73,7 @@ module Gitrb
73
73
 
74
74
  # Write an entry on specified path.
75
75
  def []=(path, entry)
76
- raise ArgumentError unless entry && GitObject === entry
76
+ raise ArgumentError unless entry && (Reference === entry || GitObject === entry)
77
77
  path = normalize_path(path)
78
78
  if path.empty?
79
79
  raise 'Empty path'
data/test/tree_test.rb CHANGED
@@ -47,6 +47,20 @@ describe Gitrb::Tree do
47
47
  ["100644", "blob", "3410062ba67c5ed59b854387a8bc0ec012479368", "c"]]
48
48
  end
49
49
 
50
+ it "should have move" do
51
+ tree = Gitrb::Tree.new(:repository => repo)
52
+ tree['x/y'] = Gitrb::Blob.new(:data => 'a')
53
+ tree['x/y'].data.should.equal 'a'
54
+ tree.save
55
+
56
+ repo.clear
57
+ tree = repo.get(tree.id)
58
+
59
+ tree.move('x/y', 'z')
60
+ tree['x/y'].should.equal nil
61
+ tree['z'].data.should.equal 'a'
62
+ end
63
+
50
64
  it "should save nested trees" do
51
65
  tree = Gitrb::Tree.new(:repository => repo)
52
66
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 2
9
- version: 0.2.2
8
+ - 3
9
+ version: 0.2.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Mendler