No commit-data loaded if branch contains a slash
Summary
If the viewed branch contains a slash in it's name gitlab fails while loading the commit-data from /{user}/{project}/refs/{branch}/logs_tree
Steps to reproduce
- create a branch with an slash inside e.g.
foo/bar
- visit
/{user}/{project}/tree/foo/bar
(note that the slash offoo/bar
has to be unescaped here in branch, if it is escaped we got a 404-page – maybe another ticket) -
Loading commit data… will load forever because the JS requested
/{user}/{project}/tree/foo%2Fbar
instead of the working/{user}/{project}/tree/foo/bar
Expected behavior
/{user}/{project}/tree/foo%2Fbar
would answer with 200-status and commit-data and Loading commit data… would be replaced by the concrete received commit-data
Actual behavior
/{user}/{project}/tree/foo%2Fbar
fails with 404-status and Loading commit data… remains forever
Relevant logs and/or screenshots
Possible fixes
This problem was already fixed but was opened again by some other issues. gitlab-com/support-forum#952 (closed) and gitlab-foss#21106 (closed)
I'm not familiar with ruby but I'm totally sure that your fixes at extracts_path.rb were at least partly wrong at all and the source of all of these issues are on other positions. I think the problem is much more regarding to the initialisation of @logs_path or it's use in the templates. Unfortunately I have no time to learn ruby nor fixing these simple bugs on my own, but the problem is definitely more abstract than the previous fixings.