summaryrefslogtreecommitdiff
path: root/lib/gitlab/git_post_receive.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-08-09 15:41:07 -0700
committerStan Hu <stanhu@gmail.com>2019-08-09 15:41:07 -0700
commitafe867921cab046a34bc463840c6e9f5d51f1f70 (patch)
treedae8e191eb1ba98217f277cb1326297ee84df82b /lib/gitlab/git_post_receive.rb
parentd96c24d81590dd6da237f131d4c074b70e64e030 (diff)
downloadgitlab-ce-afe867921cab046a34bc463840c6e9f5d51f1f70.tar.gz
Rename branches_exist? -> includes_branches?65803-invalidate-branches-cache-on-refresh
Diffstat (limited to 'lib/gitlab/git_post_receive.rb')
-rw-r--r--lib/gitlab/git_post_receive.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/gitlab/git_post_receive.rb b/lib/gitlab/git_post_receive.rb
index 307ec8b2cfb..6c7f23a673c 100644
--- a/lib/gitlab/git_post_receive.rb
+++ b/lib/gitlab/git_post_receive.rb
@@ -27,12 +27,10 @@ module Gitlab
end
end
- def branches_exist?
- changes_refs do |_oldrev, _newrev, ref|
- return true if Gitlab::Git.branch_ref?(ref) # rubocop:disable Cop/AvoidReturnFromBlocks
+ def includes_branches?
+ enum_for(:changes_refs).any? do |_oldrev, _newrev, ref|
+ Gitlab::Git.branch_ref?(ref)
end
-
- false
end
private