Class: Gitlab::GitPostReceive
- Inherits:
-
Object
- Object
- Gitlab::GitPostReceive
- Includes:
- Identifier
- Defined in:
- lib/gitlab/git_post_receive.rb
Instance Attribute Summary collapse
-
#changes ⇒ Object
readonly
Returns the value of attribute changes.
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#push_options ⇒ Object
readonly
Returns the value of attribute push_options.
Instance Method Summary collapse
- #identify ⇒ Object
- #includes_branches? ⇒ Boolean
- #includes_default_branch? ⇒ Boolean
- #includes_tags? ⇒ Boolean
-
#initialize(container, identifier, changes, push_options = {}) ⇒ GitPostReceive
constructor
A new instance of GitPostReceive.
Methods included from Identifier
#identification_cache, #identify_using_ssh_key, #identify_using_user, #identify_with_cache
Constructor Details
#initialize(container, identifier, changes, push_options = {}) ⇒ GitPostReceive
Returns a new instance of GitPostReceive.
8 9 10 11 12 13 |
# File 'lib/gitlab/git_post_receive.rb', line 8 def initialize(container, identifier, changes, = {}) @container = container @identifier = identifier @changes = parse_changes(changes) @push_options = end |
Instance Attribute Details
#changes ⇒ Object (readonly)
Returns the value of attribute changes.
6 7 8 |
# File 'lib/gitlab/git_post_receive.rb', line 6 def changes @changes end |
#container ⇒ Object (readonly)
Returns the value of attribute container.
6 7 8 |
# File 'lib/gitlab/git_post_receive.rb', line 6 def container @container end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
6 7 8 |
# File 'lib/gitlab/git_post_receive.rb', line 6 def identifier @identifier end |
#push_options ⇒ Object (readonly)
Returns the value of attribute push_options.
6 7 8 |
# File 'lib/gitlab/git_post_receive.rb', line 6 def @push_options end |
Instance Method Details
#identify ⇒ Object
15 16 17 |
# File 'lib/gitlab/git_post_receive.rb', line 15 def identify super(identifier) end |
#includes_branches? ⇒ Boolean
19 20 21 |
# File 'lib/gitlab/git_post_receive.rb', line 19 def includes_branches? changes.includes_branches? end |
#includes_default_branch? ⇒ Boolean
27 28 29 30 31 32 33 34 35 |
# File 'lib/gitlab/git_post_receive.rb', line 27 def includes_default_branch? # If the branch doesn't have a default branch yet, we presume the # first branch pushed will be the default. return true unless container.default_branch.present? changes.branch_changes.any? do |change| Gitlab::Git.branch_name(change[:ref]) == container.default_branch end end |
#includes_tags? ⇒ Boolean
23 24 25 |
# File 'lib/gitlab/git_post_receive.rb', line 23 def changes. end |