Skip to content

raw view of file of a branch with slash in there name failed #1290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Krozark opened this issue Jul 9, 2018 · 1 comment
Closed

raw view of file of a branch with slash in there name failed #1290

Krozark opened this issue Jul 9, 2018 · 1 comment
Assignees
Milestone

Comments

@Krozark
Copy link

Krozark commented Jul 9, 2018

Version : 1.8.0

How to reproduce:
Create e repertory named repo/test
create a file "README.md" in the master branch, and push it
create a branch named "feature/whatever"
create another empty file, and push it (just to create a commit)

Control:
On the web interface : repo/test > branch "master" > last commit : tree > README.md : raw : This should work

Trouble:
On the web interface : repo/test > branch "feature/whatever" > last commit : tree > README.md : raw : This should not work and we get a message like

Error
Sorry, the requested resource ./README.md was not found in feature/whatever.

However, if we make the exact same procedure on the previous commit, it's ok (repo/test > branch "feature/whatever" > previous commit : tree > README.md : raw).

Also, notice that only branch with "/" (slash) in there name are concerned

@flaix
Copy link
Member

flaix commented Oct 30, 2020

I assume the "exact same procedure on the previous commit" means in this case essentially running it on the master branch. Therefore the problem only appears on a branch with a slash in the name. If the branch has no slash in the name, it works. It also works for files which are in subdirectories, so a slash in the filename is not a problem either. Only in the branch name.

@flaix flaix self-assigned this Nov 1, 2020
@flaix flaix added this to the 1.9.2 milestone Nov 1, 2020
flaix added a commit to flaix/gitblit that referenced this issue Nov 9, 2020
When a branch has a slash in the name, the raw servlet was not able
to find the path under that branch. This is due to the replacement of
the forward slash character for URLs. It was not taken into account
when comparing the branch name later.

This fixes gitblit-org#1290 and its duplicates gitblit-org#1234 and gitblit-org#813.
@flaix flaix added Status-Fixed and removed Priority-Medium Status-Verified A bug could be reproduced. labels Nov 9, 2020
@flaix flaix closed this as completed in 6876537 Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants