Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHannes Rosenögger <123haynes@gmail.com>2015-03-11 19:53:10 +0300
committerHannes Rosenögger <123haynes@gmail.com>2015-03-11 19:53:10 +0300
commitb0c1bc6657032dcb7ef3e1943d003471b09d8b4e (patch)
treef10a5f85eb8f887c1c43dbe4c9e5b3e49e9de19f /lib
parent94affe6d51f14b9a881a5e1d06c6c7e5d734f5bc (diff)
parentb7a31a4b024e2c5f607003f1c42e2cd46adb2ff4 (diff)
Merge branch 'generate-valid-json' into 'master'
Generate valid json This patch helps to be compatible to other programing languages as it improves the validation of hook data. It seems only ruby can handle 'nil' as value while other json decode function will fatal. See merge request !182
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/push_data_builder.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/gitlab/push_data_builder.rb b/lib/gitlab/push_data_builder.rb
index 9fb0bf65949..0cc6b0ac694 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