Skip to content

Fix LFS commit finder not working #15856

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

Merged
merged 5 commits into from
May 14, 2021
Merged

Fix LFS commit finder not working #15856

merged 5 commits into from
May 14, 2021

Conversation

KN4CK3R
Copy link
Member

@KN4CK3R KN4CK3R commented May 13, 2021

Close #15850

if bytes.Equal(sha20byte, hash[:]) {

Here a [40]byte was compared with a [20]byte which always fails.
The in place conversion in To40ByteSHA messed up the trees slice because it got expanded multiple times.

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label May 13, 2021
Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath added this to the 1.15.0 milestone May 13, 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 May 14, 2021
@zeripath
Copy link
Contributor

So the bug is really that the temporary buf was being saved repeatedly in the trees instead of being copied each time.

@a1012112796
Copy link
Member

@KN4CK3R please set a meaningfull title for this pull request.

@KN4CK3R KN4CK3R changed the title Fix 15850 Fix LFS commit finder not working May 14, 2021
@zeripath zeripath merged commit df72cf6 into go-gitea:main May 14, 2021
@zeripath
Copy link
Contributor

please send backport

KN4CK3R added a commit to KN4CK3R/gitea that referenced this pull request May 14, 2021
* Create a copy of the sha bytes.

Co-authored-by: Andrew Thornton <[email protected]>
zeripath added a commit that referenced this pull request May 14, 2021
* Create a copy of the sha bytes.

Co-authored-by: Andrew Thornton <[email protected]>
@zeripath zeripath added the backport/done All backports for this PR have been created label May 14, 2021
@KN4CK3R KN4CK3R deleted the fix-15850 branch May 25, 2021 06:47
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 10, 2021
* Create a copy of the sha bytes.


Co-authored-by: Andrew Thornton <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LFS find commits internal error
5 participants