Commit 64a270a6 authored by Stan Hu's avatar Stan Hu

Fix cloning Wiki repositories via HTTP

Cloning a project Wiki over HTTP would end up cloning the main repository
since the .wiki extension was being stripped.

Closes #3106
parent a7174efa
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 8.2.0 (unreleased) v 8.2.0 (unreleased)
- Fix cloning Wiki repositories via HTTP (Stan Hu)
- Improved performance of replacing references in comments - Improved performance of replacing references in comments
- Show last project commit to default branch on project home page - Show last project commit to default branch on project home page
- Highlight comment based on anchor in URL - Highlight comment based on anchor in URL
......
...@@ -193,12 +193,19 @@ module Grack ...@@ -193,12 +193,19 @@ module Grack
end end
def render_grack_auth_ok def render_grack_auth_ok
repo_path =
if @request.path_info =~ /^([\w\.\/-]+)\.wiki\.git/
ProjectWiki.new(project).repository.path_to_repo
else
project.repository.path_to_repo
end
[ [
200, 200,
{ "Content-Type" => "application/json" }, { "Content-Type" => "application/json" },
[JSON.dump({ [JSON.dump({
'GL_ID' => Gitlab::ShellEnv.gl_id(@user), 'GL_ID' => Gitlab::ShellEnv.gl_id(@user),
'RepoPath' => project.repository.path_to_repo, 'RepoPath' => repo_path,
})] })]
] ]
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment