Skip to content

Conversation

noerw
Copy link
Member

@noerw noerw commented Oct 8, 2021

This is a stripped down backport of #17185, fixes #17179.

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

Entering this case when path does not contain a '/' doesn't 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-filename> will now work, while paths 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 #17185, but is too big of a change to functionality to backport

...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
@noerw noerw added modifies/api This PR adds API routes or modifies them type/bug labels Oct 8, 2021
@noerw noerw added this to the 1.15.4 milestone Oct 8, 2021
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Oct 8, 2021
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Oct 8, 2021
@techknowlogick techknowlogick merged commit 245596e into go-gitea:release/v1.15 Oct 8, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants