@@ -153,6 +153,30 @@ def test_inmemory_already_applied_patch
153
153
assert_equal "0f5f6d3353be1a9966fa5767b7d604b051798224" , op [ :id ]
154
154
end
155
155
156
+ def test_rebase_does_not_lose_files
157
+ commit = Rugged ::Commit . create ( @repo , {
158
+ :author => { :email => "[email protected] " , :time => Time . now , :name => "Rebaser" } ,
159
+ :message => "Add some files" ,
160
+ :parents => [ @repo . branches [ "gravy" ] . target_id ] ,
161
+ :update_ref => "refs/heads/gravy" ,
162
+ :tree => @repo . branches [ "gravy" ] . target . tree . update ( [
163
+ { :action => :upsert ,
164
+ :path => "some/nested/file" ,
165
+ :oid => Rugged ::Blob . from_buffer ( @repo , "a new blob content" ) ,
166
+ :filemode => 0100644
167
+ }
168
+ ] )
169
+ } )
170
+
171
+ rebase = Rugged ::Rebase . new ( @repo , "refs/heads/gravy" , "refs/heads/veal" )
172
+
173
+ rebase . next
174
+ assert rebase . commit ( { committer :
{ :email => "[email protected] " , :name => "Rebaser" } } )
175
+
176
+ rebase . next
177
+ assert rebase . commit ( { committer :
{ :email => "[email protected] " , :name => "Rebaser" } } )
178
+ end
179
+
156
180
def test_inmemory_rebase_does_not_lose_files
157
181
commit = Rugged ::Commit . create ( @repo , {
158
182
:author => { :email => "[email protected] " , :time => Time . now , :name => "Rebaser" } ,
0 commit comments