Skip to content

Commit

Permalink
Fix a bug where the project's repository path was returned instead of…
Browse files Browse the repository at this point in the history
… the wiki path
  • Loading branch information
ikbenale committed Jul 16, 2016
1 parent 4f25e31 commit e94d383
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
7 changes: 6 additions & 1 deletion lib/api/internal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ def project
if access_status.status
# Return the repository full path so that gitlab-shell has it when
# handling ssh commands
response[:repository_path] = project.repository.path_to_repo
response[:repository_path] =
if wiki?
project.wiki.repository.path_to_repo
else
project.repository.path_to_repo
end
end

response
Expand Down
14 changes: 11 additions & 3 deletions spec/requests/api/internal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,21 @@

context "git push with project.wiki" do
it 'responds with success' do
project_wiki = create(:project, name: 'my.wiki', path: 'my.wiki')
project_wiki.team << [user, :developer]
push(key, project.wiki)

push(key, project_wiki)
expect(response).to have_http_status(200)
expect(json_response["status"]).to be_truthy
expect(json_response["repository_path"]).to eq(project.wiki.repository.path_to_repo)
end
end

context "git pull with project.wiki" do
it 'responds with success' do
pull(key, project.wiki)

expect(response).to have_http_status(200)
expect(json_response["status"]).to be_truthy
expect(json_response["repository_path"]).to eq(project.wiki.repository.path_to_repo)
end
end

Expand Down

0 comments on commit e94d383

Please sign in to comment.