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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f6112122
Commit
f6112122
authored
Apr 11, 2018
by
Ahmad Sherif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix finding wiki file when Gitaly is enabled
Fixes gitaly#1126
parent
37a56324
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
3 deletions
+16
-3
changelogs/unreleased/fix-wiki-find-file-gitaly.yml
changelogs/unreleased/fix-wiki-find-file-gitaly.yml
+5
-0
lib/gitlab/gitaly_client/wiki_service.rb
lib/gitlab/gitaly_client/wiki_service.rb
+1
-1
spec/fixtures/big-image.png
spec/fixtures/big-image.png
+0
-0
spec/models/project_wiki_spec.rb
spec/models/project_wiki_spec.rb
+10
-2
No files found.
changelogs/unreleased/fix-wiki-find-file-gitaly.yml
0 → 100644
View file @
f6112122
---
title
:
Fix finding wiki file when Gitaly is enabled
merge_request
:
author
:
type
:
fixed
lib/gitlab/gitaly_client/wiki_service.rb
View file @
f6112122
...
...
@@ -136,7 +136,7 @@ module Gitlab
wiki_file
=
nil
response
.
each
do
|
message
|
next
unless
message
.
name
.
present?
next
unless
message
.
name
.
present?
||
wiki_file
if
wiki_file
wiki_file
.
raw_data
<<
message
.
raw_data
...
...
spec/fixtures/big-image.png
0 → 100644
View file @
f6112122
317 KB
spec/models/project_wiki_spec.rb
View file @
f6112122
...
...
@@ -172,11 +172,12 @@ describe ProjectWiki do
describe
'#find_file'
do
shared_examples
'finding a wiki file'
do
let
(
:image
)
{
File
.
open
(
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'big-image.png'
))
}
before
do
file
=
File
.
open
(
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'dk.png'
))
subject
.
wiki
# Make sure the wiki repo exists
BareRepoOperations
.
new
(
subject
.
repository
.
path_to_repo
).
commit_file
(
fil
e
,
'image.png'
)
BareRepoOperations
.
new
(
subject
.
repository
.
path_to_repo
).
commit_file
(
imag
e
,
'image.png'
)
end
it
'returns the latest version of the file if it exists'
do
...
...
@@ -192,6 +193,13 @@ describe ProjectWiki do
file
=
subject
.
find_file
(
'image.png'
)
expect
(
file
).
to
be_a
Gitlab
::
Git
::
WikiFile
end
it
'returns the whole file'
do
file
=
subject
.
find_file
(
'image.png'
)
image
.
rewind
expect
(
file
.
raw_data
.
b
).
to
eq
(
image
.
read
.
b
)
end
end
context
'when Gitaly wiki_find_file is enabled'
do
...
...
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