BigW Consortium Gitlab
Previously this method would directly receive the output of tag_name(). This method could either return a String or nil. In the previous setup this would somehow magically work but because Rugged::TagCollection#[] doesn't accept nil values it started to fail. To work around this the elsif in change_access_check() assigns the result of tag_name() to a local and then _only_ calls protected_tag?() if the tag name is not nil. The extra parenthesis are put in place to ensure that things are parsed correctly, without these the code would be parsed as follows: elsif tag_ref = (tag_name(ref) && protected_tag(tag_ref)) During runtime this would basically resolve to: elsif tag_ref = (tag_name(ref) && protected_tag(nil)) This is because when you refer to the variable you're assigning _in_ the assignment Ruby returns nil instead of raising an error.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
api | Loading commit data... | |
assets | Loading commit data... | |
backup | Loading commit data... | |
banzai | Loading commit data... | |
ci | Loading commit data... | |
gitlab | Loading commit data... | |
omni_auth | Loading commit data... | |
rouge/formatters | Loading commit data... | |
support | Loading commit data... | |
tasks | Loading commit data... | |
award_emoji.rb | Loading commit data... | |
banzai.rb | Loading commit data... | |
disable_email_interceptor.rb | Loading commit data... | |
event_filter.rb | Loading commit data... | |
extracts_path.rb | Loading commit data... | |
file_size_validator.rb | Loading commit data... | |
file_streamer.rb | Loading commit data... | |
gitlab.rb | Loading commit data... | |
gt_one_coercion.rb | Loading commit data... | |
repository_cache.rb | Loading commit data... | |
static_model.rb | Loading commit data... | |
unfold_form.rb | Loading commit data... | |
uploaded_file.rb | Loading commit data... | |
version_check.rb | Loading commit data... |