1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-24 01:11:12 +00:00

fix Ruby 2.2 warning at lib/redmine/scm/adapters/cvs_adapter.rb

On ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]:

<pre>
lib/redmine/scm/adapters/cvs_adapter.rb:342:
  warning: Comparable#== will no more rescue exceptions of #<=> in the next release.
lib/redmine/scm/adapters/cvs_adapter.rb:342:
  warning: Return nil in #<=> if the comparison is inappropriate or avoid such comparison.
</pre>

git-svn-id: http://svn.redmine.org/redmine/trunk@13831 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2015-01-03 17:31:01 +00:00
parent 9da6bb31c1
commit a9298224b1

View File

@ -339,7 +339,7 @@ module Redmine
# convert a date/time into the CVS-format
def time_to_cvstime(time)
return nil if time.nil?
time = Time.now if time == 'HEAD'
time = Time.now if (time.kind_of?(String) && time == 'HEAD')
unless time.kind_of? Time
time = Time.parse(time)