diff options
author | Robert Speicher <robert@gitlab.com> | 2015-10-23 14:31:01 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2015-10-23 14:31:01 +0300 |
commit | 2b51823017faec1d75852bcd318bd502099d692d (patch) | |
tree | 92adba83b1b34695a5276c92663302052f2076b2 /lib | |
parent | 7f5acdb20ac9b5908e6cf15c8fb5f7952a745f1c (diff) | |
parent | 69e5e260b0bd28cd48983494b2765e1cef0d3c38 (diff) |
Merge branch 'fix-wiki-clone-over-http' into 'master'
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
See merge request !1676
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 |