diff options
author | Nicole Cordes <cordes@cps-it.de> | 2014-09-03 22:28:04 +0200 |
---|---|---|
committer | Nicole Cordes <cordes@cps-it.de> | 2015-03-10 10:07:25 +0100 |
commit | b7a31a4b024e2c5f607003f1c42e2cd46adb2ff4 (patch) | |
tree | b525911165dcb33506f18421f3c935b45cfda122 /lib/gitlab/push_data_builder.rb | |
parent | e0caed91e2cd6b959f808139df7c40f3644f88fd (diff) | |
download | gitlab-ce-b7a31a4b024e2c5f607003f1c42e2cd46adb2ff4.tar.gz |
Generate valid json for hooks
It seems that ruby can handle 'nil' value but other json processors
(like PHP) throw an error. This is always generated for empty arrays.
Diffstat (limited to 'lib/gitlab/push_data_builder.rb')
-rw-r--r-- | lib/gitlab/push_data_builder.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/gitlab/push_data_builder.rb b/lib/gitlab/push_data_builder.rb index 5cefa67d3ab..ea06e1f7333 100644 --- a/lib/gitlab/push_data_builder.rb +++ b/lib/gitlab/push_data_builder.rb @@ -58,6 +58,7 @@ module Gitlab data[:commits] << commit.hook_attrs(project) end + data[:commits] = "" if data[:commits].count == 0 data end |