Files
gitlabhq/lib/gitlab
Yorick Peterse 003671207d Fix passing nil to protected_tag?
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.
2016-05-05 19:46:26 +02:00
..
2015-11-30 18:36:34 +02:00
2015-12-15 00:53:52 -02:00
2014-09-29 12:05:17 +03:00
2016-04-11 18:01:51 -05:00
2015-11-18 13:31:18 +01:00
2014-10-06 00:14:46 +02:00
2015-02-24 15:07:24 +01:00
2016-04-13 13:12:05 +03:00
2014-10-06 00:14:46 +02:00
2016-04-28 21:28:39 +02:00
2015-09-08 20:23:01 -04:00
2014-10-31 17:22:16 -07:00
2015-04-14 15:58:28 +02:00
2014-10-06 00:14:46 +02:00
2015-03-24 18:35:57 -07:00
2014-10-06 00:14:46 +02:00
2016-04-13 20:57:19 +03:00
2015-11-26 17:03:43 +02:00
2014-10-06 00:14:46 +02:00
2015-08-26 11:30:38 -07:00
2016-03-10 12:37:14 +01:00
2013-06-06 10:10:51 +09:00
2016-03-20 23:26:58 +01:00
2016-02-11 18:10:14 +01:00