Update Wiki#delete_page to use Index#read_tree awesomes.
This commit is contained in:
+3
-3
@@ -185,10 +185,10 @@ module Gollum
|
|||||||
# Returns the String SHA1 of the newly written version.
|
# Returns the String SHA1 of the newly written version.
|
||||||
def delete_page(page, commit)
|
def delete_page(page, commit)
|
||||||
pcommit = @repo.commit('master')
|
pcommit = @repo.commit('master')
|
||||||
map = tree_map(pcommit.tree)
|
|
||||||
|
|
||||||
map = delete_from_tree_map(map, page.path)
|
index = self.repo.index
|
||||||
index = tree_map_to_index(map)
|
index.read_tree(pcommit.tree.id)
|
||||||
|
index.delete(page.path)
|
||||||
|
|
||||||
actor = Grit::Actor.new(commit[:name], commit[:email])
|
actor = Grit::Actor.new(commit[:name], commit[:email])
|
||||||
index.commit(commit[:message], [pcommit], actor)
|
index.commit(commit[:message], [pcommit], actor)
|
||||||
|
|||||||
Reference in New Issue
Block a user