summaryrefslogtreecommitdiff
path: root/app/services/files/update_service.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-24 09:38:44 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-24 09:55:01 -0600
commitc72e71552209aae964e5aa931d435f7e1164e5d1 (patch)
tree2e7a17e1216e8286ba885f9d0517330b9148b879 /app/services/files/update_service.rb
parenta530e9da3580e05a171b3ba0a3f4408afc000b10 (diff)
downloadgitlab-ce-c72e71552209aae964e5aa931d435f7e1164e5d1.tar.gz
Raise error when no content is provided
Diffstat (limited to 'app/services/files/update_service.rb')
-rw-r--r--app/services/files/update_service.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/services/files/update_service.rb b/app/services/files/update_service.rb
index a71fe61a4b6..462de06b6ff 100644
--- a/app/services/files/update_service.rb
+++ b/app/services/files/update_service.rb
@@ -18,6 +18,10 @@ module Files
def validate
super
+ if @file_content.empty?
+ raise_error("You must provide content.")
+ end
+
if file_has_changed?
raise FileChangedError.new("You are attempting to update a file that has changed since you started editing it.")
end