Skip to content
This repository has been archived by the owner on Apr 19, 2019. It is now read-only.

Commit

Permalink
Use Grit to determine committer instead of executing a sub-shell and …
Browse files Browse the repository at this point in the history
…calling the git CLI.
  • Loading branch information
MrJoy authored and technoweenie committed Aug 31, 2010
1 parent 515f861 commit 1f8a675
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/gollum/frontend/app.rb
Expand Up @@ -58,7 +58,7 @@ class App < Sinatra::Base
format = params[:format].intern
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}"
end
Expand All @@ -70,7 +70,7 @@ class App < Sinatra::Base
format = params[:format].intern

begin
wiki.write_page(name, format, params[:content], commit_message)
wiki.write_page(name, format, params[:content], commit_message(wiki))
redirect "/#{name}"
rescue Gollum::DuplicatePageError => e
@message = "Duplicate page: #{e.message}"
Expand Down Expand Up @@ -148,10 +148,10 @@ def show_page_or_file(name)
end
end

def commit_message
def commit_message(wiki)
{ :message => params[:message],
:name => `git config --get user.name `.strip,
:email => `git config --get user.email`.strip }
:name => wiki.repo.config['user.name'],
:email => wiki.repo.config['user.email'] }
end
end
end

0 comments on commit 1f8a675

Please sign in to comment.