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
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2016-07-19 22:01:30 +0300
committerAhmad Sherif <me@ahmadsherif.com>2016-07-19 22:22:58 +0300
commit41b25e5a0d64d33d2d23aaaf3effa79a717f890e (patch)
treea4f2f47b8d90cc7aebf75eb2e8b4681493668d63 /lib/gitlab/checks/force_push.rb
parentb269a6d5a99afb2b4c2bc2ca8f31622ec89bee1d (diff)
Limit git rev-list output count to one in forced push check
Diffstat (limited to 'lib/gitlab/checks/force_push.rb')
-rw-r--r--lib/gitlab/checks/force_push.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/checks/force_push.rb b/lib/gitlab/checks/force_push.rb
index dfa83a0eab3..5fe86553bd0 100644
--- a/lib/gitlab/checks/force_push.rb
+++ b/lib/gitlab/checks/force_push.rb
@@ -8,8 +8,8 @@ module Gitlab
if Gitlab::Git.blank_ref?(oldrev) || Gitlab::Git.blank_ref?(newrev)
false
else
- missed_refs, _ = Gitlab::Popen.popen(%W(#{Gitlab.config.git.bin_path} --git-dir=#{project.repository.path_to_repo} rev-list #{oldrev} ^#{newrev}))
- missed_refs.split("\n").size > 0
+ missed_ref, _ = Gitlab::Popen.popen(%W(#{Gitlab.config.git.bin_path} --git-dir=#{project.repository.path_to_repo} rev-list --max-count=1 #{oldrev} ^#{newrev}))
+ missed_ref.present?
end
end
end