Skip to content

Commit 411a304

Browse files
Show that doing a non-inmemory rebase works.
1 parent a3573fd commit 411a304

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/rebase_test.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,30 @@ def test_inmemory_already_applied_patch
153153
assert_equal "0f5f6d3353be1a9966fa5767b7d604b051798224", op[:id]
154154
end
155155

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+
156180
def test_inmemory_rebase_does_not_lose_files
157181
commit = Rugged::Commit.create(@repo, {
158182
:author => { :email => "[email protected]", :time => Time.now, :name => "Rebaser" },

0 commit comments

Comments
 (0)