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 | |
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
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | lib/gitlab/backend/grack_auth.rb | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG index fa630f354c4..6d2e55dbbd5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.2.0 (unreleased) + - Fix cloning Wiki repositories via HTTP (Stan Hu) - Improved performance of replacing references in comments - Show last project commit to default branch on project home page - Highlight comment based on anchor in URL 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 |