Skip to content
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

Fix IsObjectExist with gogit (#31790) #31806

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

GiteaBot
Copy link
Contributor

@GiteaBot GiteaBot commented Aug 9, 2024

Backport #31790 by @wolfogre

Fix #31271.

When gogit is enabled, IsObjectExist calls repo.gogitRepo.ResolveRevision, which is not correct. It's for checking references not objects, it could work with commit hash since it's both a valid reference and a commit object, but it doesn't work with blob objects.

So it causes #31271 because it reports that all blob objects do not exist.

Fix go-gitea#31271.

When gogit is enabled, `IsObjectExist` calls
`repo.gogitRepo.ResolveRevision`, which is not correct. It's for
checking references not objects, it could work with commit hash since
it's both a valid reference and a commit object, but it doesn't work
with blob objects.

So it causes go-gitea#31271 because it reports that all blob objects do not
exist.
@GiteaBot GiteaBot added issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP modifies/go Pull requests that update Go code type/bug labels Aug 9, 2024
@GiteaBot GiteaBot added this to the 1.22.2 milestone Aug 9, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 9, 2024
@GiteaBot GiteaBot requested review from lafriks and lunny August 9, 2024 02:40
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 9, 2024
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 9, 2024
@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 Aug 9, 2024
@wolfogre wolfogre merged commit 144648a into go-gitea:release/v1.22 Aug 9, 2024
26 checks passed
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants