Update Wiki#delete_page to use Index#read_tree awesomes.

This commit is contained in:
Tom Preston-Werner
2010-08-19 17:37:49 -07:00
parent b1fc173a3f
commit 9b32d3bfb1
+3 -3
View File
@@ -185,10 +185,10 @@ module Gollum
# Returns the String SHA1 of the newly written version.
def delete_page(page, commit)
pcommit = @repo.commit('master')
map = tree_map(pcommit.tree)
map = delete_from_tree_map(map, page.path)
index = tree_map_to_index(map)
index = self.repo.index
index.read_tree(pcommit.tree.id)
index.delete(page.path)
actor = Grit::Actor.new(commit[:name], commit[:email])
index.commit(commit[:message], [pcommit], actor)