diff --git a/CHANGELOG b/CHANGELOG index a5d26db7626ccda1f0935253fb1c46ce1abfcabd..d60d25d9ac4182fd067bfb0d5522f6b51e1a9580 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.11.0 (unreleased) - Fix of 'Commits being passed to custom hooks are already reachable when using the UI' + - Limit git rev-list output count to one in forced push check v 8.10.0 (unreleased) - Fix profile activity heatmap to show correct day name (eanplatter) diff --git a/lib/gitlab/checks/force_push.rb b/lib/gitlab/checks/force_push.rb index dfa83a0eab352ec78c2e07a4d5d380a713d5f747..5fe86553bd014486944dc6fa936457e490e93628 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