src-d / go-git

Project has been moved to: https://github.com/go-git/go-git
https://github.com/go-git/go-git
Apache License 2.0
4.9k stars 541 forks source link

could not get blob from packfiles #1153

Open vvatanabe opened 5 years ago

vvatanabe commented 5 years ago

fixes by #1149

First, I updated the test case to reproduce the problem, and I will add a patch to fix this problem.

vvatanabe commented 5 years ago

This problem was reproduced a build below. https://travis-ci.org/src-d/go-git/builds/533637111

vvatanabe commented 5 years ago

Fixed, plz chk it.

mcuadros commented 5 years ago

If I am not wrong the .tmp files are files to ignore, are you sure that git is reading this files?

vvatanabe commented 5 years ago

Yes. We provide Git hosting service and tried go-git experimentally.

When git gc did not complete successfully on bare repository, .tmp_xxx.pack remained. And when using func (r *Repository) BlobObject(h plumbing.Hash) (*object.Blob, error) to get a packed blob read .tmp_xxx.pack internally and occured a error by to get a wrong hash.

filipnavara commented 5 years ago

Related: https://github.com/src-d/go-git/issues/1223. As I mentioned in https://github.com/src-d/go-git/issues/1149#issuecomment-492969265 the logic that GIT uses is actually different. I don't think the .tmp files should be ignored but the objects/info/packs file should be consulted.

mcuadros commented 4 years ago

Merged in https://github.com/go-git/go-git/pull/6

saracen commented 4 years ago

@mcuadros Super happy to see go-git continuing! I only found out it'd moved from this PR. The new repository mentions there was some legal issues - are you able to post a little about that somewhere and maybe post to r/golang about where the project has now landed?

EDIT: Thank you!