Skip to content

Don't try to interpret treepath as hash when path contains no hash-path-separator ('/') (#17272) #32338

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
wants to merge 4 commits into from

Conversation

lunny
Copy link
Member

@lunny lunny commented Oct 24, 2024

This is a workaround to #17179.

Entering this case when path does not contain a '/' does not really
make sense, as that means the tree path is empty, but this case is only
entered for routes that expect a non-empty tree path.

Treepaths like <40-char-dirname>/ will still fail,
but hopefully don't occur that often. A more complete fix that avoids
this case too is outlined in #17185, but too big of a change to backport

noerw and others added 2 commits October 24, 2024 16:10
...when path contains no hash-path-separator ('/')

This is a workaround to go-gitea#17179.

Entering this case when `path` does not contain a '/' does not really
make sense, as that means the tree path is empty, but this case is only
entered for routes that expect a non-empty tree path.

Treepaths like <40-char-dirname>/<filename> will still fail,
but hopefully don't occur that often. A more complete fix that avoids
this case too is outlined in go-gitea#17185, but too big of a change to backport
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 24, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Oct 24, 2024
@lunny lunny added the backport/v1.22 This PR should be backported to Gitea 1.22 label Oct 25, 2024
@lunny lunny marked this pull request as ready for review October 26, 2024 17:53
@lunny lunny added the type/bug label Oct 26, 2024
@yp05327 yp05327 self-requested a review November 2, 2024 06:14
@wxiaoguang
Copy link
Contributor

I do not think it is right or necessary.

@wxiaoguang
Copy link
Contributor

Please use this one to properly "fix" the problem: Refactor RepoRefByType #32413

@lunny lunny closed this Nov 5, 2024
@lunny lunny deleted the lunny/fix-raw-file branch November 5, 2024 04:27
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Feb 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/v1.22 This PR should be backported to Gitea 1.22 lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants