Project

General

Profile

Actions

Defect #2967

closed

Git revisions, diffs and entries not showing if filename has period in it.

Added by Marlin Forbes over 15 years ago. Updated over 15 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
SCM
Target version:
-
Start date:
2009-03-13
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

I'm running r2580 of Redmine;
Rails 2.2.2
Ruby 1.8.6

I've had this problem before with svn, and now also with git, where many of the links in the repository browser show up as 404 Not Found.

I did some debugging in the source, and noticed that URLs where a period character is included were not being routed to the controller method.

This obviously poses a serious issue with URLs like the following (which pretty much everyone has):

http://example.org/projects/myfirstproject/repository/revisions/beb8242c47586e502cd96d9a33b74394d0927064/entry/somedir/somefile.php

I've tracked this down to a problem with ActionController, which wants to use the period as a separator for its .:format modifier. I see you are using that in the controller, but the controller never gets called because the router doesn't recognize it for that controller.

While going through the code, I also noticed an obvious error in config/routes.rb. Lines 212 - 221 used to read repositories.connect, instead of the scoped repository_views.connect.

210   map.with_options :controller => 'repositories' do |repositories|
211     repositories.with_options :conditions => {:method => :get} do |repository_views|
212       repository_views.connect 'projects/:id/repository', :action => 'show'
213       repository_views.connect 'projects/:id/repository/edit', :action => 'edit'
214       repository_views.connect 'projects/:id/repository/statistics', :action => 'stats'
215       repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions'
216       repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions'
217       repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
218       repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
219       repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
220       repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path'
221       repository_views.connect 'projects/:id/repository/:action/*path'
222     end
Actions

Also available in: Atom PDF