summaryrefslogtreecommitdiff
path: root/app/models/project_wiki.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-03-16 21:30:30 -0700
committerStan Hu <stanhu@gmail.com>2019-03-16 21:32:22 -0700
commitda18211fec5ecb9581a5075d22adec743bb9f901 (patch)
treed74591eed9e488f81de205627eccbad18492a32e /app/models/project_wiki.rb
parent250f6ad27963c311e757392b886397c930d6918a (diff)
downloadgitlab-ce-da18211fec5ecb9581a5075d22adec743bb9f901.tar.gz
Fix Error 500 when user commits Wiki page with no commit message
Previously if a user submitted a blank commit message, Gitaly would error out with `3:WikiWritePage: empty CommitDetails.Message` since Gitaly checks whether any content is present for the message. We now use a default commit message if a user leaves it blank. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59065
Diffstat (limited to 'app/models/project_wiki.rb')
-rw-r--r--app/models/project_wiki.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb
index c43bd45a62f..6ea0716c192 100644
--- a/app/models/project_wiki.rb
+++ b/app/models/project_wiki.rb
@@ -183,7 +183,7 @@ class ProjectWiki
end
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)
Gitlab::Git::Wiki::CommitDetails.new(@user.id,