Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
c401e833
Commit
c401e833
authored
9 years ago
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated internal.rb and spec based on MR feedback
parent
5c271ee9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
lib/api/internal.rb
lib/api/internal.rb
+3
-3
spec/requests/api/internal_spec.rb
spec/requests/api/internal_spec.rb
+8
-2
No files found.
lib/api/internal.rb
View file @
c401e833
...
...
@@ -16,7 +16,7 @@ module API
#
helpers
do
def
wiki
def
wiki
?
@wiki
||=
params
[
:project
].
end_with?
(
'.wiki'
)
&&
!
Project
.
find_with_namespace
(
params
[
:project
])
end
...
...
@@ -38,12 +38,12 @@ module API
# Strip out the .wiki from the pathname before finding the
# project. This applies the correct project permissions to
# the wiki repository as well.
project_path
.
chomp!
(
'.wiki'
)
if
wiki
project_path
.
chomp!
(
'.wiki'
)
if
wiki
?
project
=
Project
.
find_with_namespace
(
project_path
)
access
=
if
wiki
if
wiki
?
Gitlab
::
GitAccessWiki
.
new
(
actor
,
project
)
else
Gitlab
::
GitAccess
.
new
(
actor
,
project
)
...
...
This diff is collapsed.
Click to expand it.
spec/requests/api/internal_spec.rb
View file @
c401e833
...
...
@@ -6,6 +6,8 @@ describe API::API, api: true do
let
(
:key
)
{
create
(
:key
,
user:
user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:secret_token
)
{
File
.
read
Gitlab
.
config
.
gitlab_shell
.
secret_file
}
# Project with path ending in .wiki
let
(
:project_wiki
)
{
create
(
:project
,
name:
'my.wiki'
,
path:
'my.wiki'
)
}
describe
"GET /internal/check"
,
no_db:
true
do
it
do
...
...
@@ -55,9 +57,13 @@ describe API::API, api: true do
end
context
"git push with project.wiki"
do
let
(
:project
)
{
create
(
:project
,
name:
'my.wiki'
,
path:
'my.wiki'
)
}
before
do
project_wiki
.
team
<<
[
user
,
:developer
]
end
it
do
push
(
key
,
project
)
push
(
key
,
project
_wiki
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
[
"status"
]).
to
be_truthy
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment