diff options
author | Stan Hu <stanhu@gmail.com> | 2015-10-22 13:53:12 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-10-22 13:53:12 -0700 |
commit | 64a270a6455d474926aaa8be281c88fca072a113 (patch) | |
tree | a8f90080632983e32778ae59f1ca55e46cc140fe /lib | |
parent | a7174efaec77e9408900336b5941d9cca1f82ccf (diff) | |
download | gitlab-ce-64a270a6455d474926aaa8be281c88fca072a113.tar.gz |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/backend/grack_auth.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb index 6830a916bcb..85a2d1a93a7 100644 --- a/lib/gitlab/backend/grack_auth.rb +++ b/lib/gitlab/backend/grack_auth.rb @@ -193,12 +193,19 @@ module Grack end 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, { "Content-Type" => "application/json" }, [JSON.dump({ 'GL_ID' => Gitlab::ShellEnv.gl_id(@user), - 'RepoPath' => project.repository.path_to_repo, + 'RepoPath' => repo_path, })] ] end |