diff options
author | Hiroyuki Sato <sathiroyuki@gmail.com> | 2016-02-28 21:11:43 +0900 |
---|---|---|
committer | Hiroyuki Sato <sathiroyuki@gmail.com> | 2016-03-16 02:17:07 +0900 |
commit | 8acad49fe0a492c2f4e16756135679b3a190543b (patch) | |
tree | 34971a3f5b8a3c7356a27ff8687fe65f64de37e2 /app/models/project_wiki.rb | |
parent | 37707ac59e6c4e6db2b758338e13cb089dacd8c7 (diff) | |
download | gitlab-ce-8acad49fe0a492c2f4e16756135679b3a190543b.tar.gz |
Support Wiki with UTF-8 page name
Diffstat (limited to 'app/models/project_wiki.rb')
-rw-r--r-- | app/models/project_wiki.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb index c96e6f0b8ea..59b1b86d1fb 100644 --- a/app/models/project_wiki.rb +++ b/app/models/project_wiki.rb @@ -2,7 +2,7 @@ class ProjectWiki include Gitlab::ShellAdapter MARKUPS = { - 'Markdown' => :md, + 'Markdown' => :markdown, 'RDoc' => :rdoc, 'AsciiDoc' => :asciidoc } unless defined?(MARKUPS) @@ -47,7 +47,7 @@ class ProjectWiki def wiki @wiki ||= begin Gollum::Wiki.new(path_to_repo) - rescue Gollum::NoSuchPathError + rescue Rugged::OSError create_repo! end end @@ -90,7 +90,7 @@ class ProjectWiki def create_page(title, content, format = :markdown, message = nil) commit = commit_details(:created, message, title) - wiki.write_page(title, format, content, commit) + wiki.write_page(title, format.to_sym, content, commit) update_project_activity rescue Gollum::DuplicatePageError => e @@ -101,7 +101,7 @@ class ProjectWiki def update_page(page, content, format = :markdown, message = nil) commit = commit_details(:updated, message, page.title) - wiki.update_page(page, page.name, format, content, commit) + wiki.update_page(page, page.name, format.to_sym, content, commit) update_project_activity end |