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
84491d0e
Commit
84491d0e
authored
Mar 18, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
aac2a959
a52d7dfa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
app/models/project_wiki.rb
app/models/project_wiki.rb
+1
-1
changelogs/unreleased/sh-fix-issue-59065.yml
changelogs/unreleased/sh-fix-issue-59065.yml
+5
-0
spec/models/project_wiki_spec.rb
spec/models/project_wiki_spec.rb
+8
-0
No files found.
app/models/project_wiki.rb
View file @
84491d0e
...
@@ -183,7 +183,7 @@ class ProjectWiki
...
@@ -183,7 +183,7 @@ class ProjectWiki
end
end
def
commit_details
(
action
,
message
=
nil
,
title
=
nil
)
def
commit_details
(
action
,
message
=
nil
,
title
=
nil
)
commit_message
=
message
||
default_message
(
action
,
title
)
commit_message
=
message
.
presence
||
default_message
(
action
,
title
)
git_user
=
Gitlab
::
Git
::
User
.
from_gitlab
(
@user
)
git_user
=
Gitlab
::
Git
::
User
.
from_gitlab
(
@user
)
Gitlab
::
Git
::
Wiki
::
CommitDetails
.
new
(
@user
.
id
,
Gitlab
::
Git
::
Wiki
::
CommitDetails
.
new
(
@user
.
id
,
...
...
changelogs/unreleased/sh-fix-issue-59065.yml
0 → 100644
View file @
84491d0e
---
title
:
Fix Error 500 when user commits Wiki page with no commit message
merge_request
:
26247
author
:
type
:
fixed
spec/models/project_wiki_spec.rb
View file @
84491d0e
...
@@ -79,6 +79,14 @@ describe ProjectWiki do
...
@@ -79,6 +79,14 @@ describe ProjectWiki do
expect
(
project_wiki
.
create_page
(
"index"
,
"test content"
)).
to
be_truthy
expect
(
project_wiki
.
create_page
(
"index"
,
"test content"
)).
to
be_truthy
end
end
it
"creates a new wiki repo with a default commit message"
do
expect
(
project_wiki
.
create_page
(
"index"
,
"test content"
,
:markdown
,
""
)).
to
be_truthy
page
=
project_wiki
.
find_page
(
'index'
)
expect
(
page
.
last_version
.
message
).
to
eq
(
"
#{
user
.
username
}
created page: index"
)
end
it
"raises CouldNotCreateWikiError if it can't create the wiki repository"
do
it
"raises CouldNotCreateWikiError if it can't create the wiki repository"
do
# Create a fresh project which will not have a wiki
# Create a fresh project which will not have a wiki
project_wiki
=
described_class
.
new
(
create
(
:project
),
user
)
project_wiki
=
described_class
.
new
(
create
(
:project
),
user
)
...
...
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