Use Grit to determine committer instead of executing a sub-shell and calling the git CLI.
This commit is contained in:
@@ -58,7 +58,7 @@ module Precious
|
|||||||
format = params[:format].intern
|
format = params[:format].intern
|
||||||
name = params[:rename] if params[:rename]
|
name = params[:rename] if params[:rename]
|
||||||
|
|
||||||
wiki.update_page(page, name, format, params[:content], commit_message)
|
wiki.update_page(page, name, format, params[:content], commit_message(wiki))
|
||||||
|
|
||||||
redirect "/#{Gollum::Page.cname name}"
|
redirect "/#{Gollum::Page.cname name}"
|
||||||
end
|
end
|
||||||
@@ -70,7 +70,7 @@ module Precious
|
|||||||
format = params[:format].intern
|
format = params[:format].intern
|
||||||
|
|
||||||
begin
|
begin
|
||||||
wiki.write_page(name, format, params[:content], commit_message)
|
wiki.write_page(name, format, params[:content], commit_message(wiki))
|
||||||
redirect "/#{name}"
|
redirect "/#{name}"
|
||||||
rescue Gollum::DuplicatePageError => e
|
rescue Gollum::DuplicatePageError => e
|
||||||
@message = "Duplicate page: #{e.message}"
|
@message = "Duplicate page: #{e.message}"
|
||||||
@@ -148,10 +148,10 @@ module Precious
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def commit_message
|
def commit_message(wiki)
|
||||||
{ :message => params[:message],
|
{ :message => params[:message],
|
||||||
:name => `git config --get user.name `.strip,
|
:name => wiki.repo.config['user.name'],
|
||||||
:email => `git config --get user.email`.strip }
|
:email => wiki.repo.config['user.email'] }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user