Project

General

Profile

Defect #37586 ยป 37586.patch

Go MAEDA, 2022-08-24 16:01

View differences:

lib/redmine/scm/adapters/abstract_adapter.rb
161 161
          path.start_with?('/') ? path : "/#{path}"
162 162
        end
163 163

  
164
        def with_trailling_slash(path)
164
        def with_trailing_slash(path)
165 165
          path ||= ''
166 166
          path.end_with?('/') ? path : "#{path}/"
167 167
        end
168 168

  
169
        def with_trailling_slash(path)
170
          ActiveSupport::Deprecation.warn 'Redmine::Scm::Adapters::AbstractAdapter#with_trailling_slash is deprecated and will be removed in Redmine 6.0. Please use #with_trailing_slash instead.'
171
          with_trailing_slash(path)
172
        end
173

  
169 174
        def without_leading_slash(path)
170 175
          path ||= ''
171 176
          path.gsub(%r{^/+}, '')
172 177
        end
173 178

  
174
        def without_trailling_slash(path)
179
        def without_trailing_slash(path)
175 180
          path ||= ''
176 181
          path.end_with?('/') ? path[0..-2] : path
177 182
        end
178 183

  
184
        def without_trailling_slash(path)
185
          ActiveSupport::Deprecation.warn 'Redmine::Scm::Adapters::AbstractAdapter#without_trailling_slash is deprecated and will be removed in Redmine 6.0. Please use #without_trailing_slash instead.'
186
          without_trailing_slash(path)
187
        end
188

  
179 189
        def valid_name?(name)
180 190
          return true if name.nil?
181 191
          return true if name.is_a?(Integer) && name > 0
lib/redmine/scm/adapters/filesystem_adapter.rb
36 36

  
37 37
        def initialize(url, root_url=nil, login=nil, password=nil,
38 38
                       path_encoding=nil)
39
          @url = with_trailling_slash(url)
39
          @url = with_trailing_slash(url)
40 40
          @path_encoding = path_encoding.blank? ? 'UTF-8' : path_encoding
41 41
        end
42 42

  
......
47 47
        def format_path_ends(path, leading=true, trailling=true)
48 48
          path = leading ? with_leading_slash(path) :
49 49
            without_leading_slash(path)
50
          trailling ? with_trailling_slash(path) :
51
            without_trailling_slash(path)
50
          trailling ? with_trailing_slash(path) :
51
            without_trailing_slash(path)
52 52
        end
53 53

  
54 54
        def info
lib/redmine/scm/adapters/mercurial_adapter.rb
154 154
              # do nothing
155 155
            end
156 156
          end
157
          path_prefix = path.blank? ? '' : with_trailling_slash(path)
157
          path_prefix = path.blank? ? '' : with_trailing_slash(path)
158 158

  
159 159
          entries = Entries.new
160 160
          as_ary(manifest['dir']).each do |e|
    (1-1/1)