go-git icon indicating copy to clipboard operation
go-git copied to clipboard

could not get blob from packfiles

Open vvatanabe opened this issue 5 years ago • 7 comments

fixes by #1149

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

vvatanabe avatar May 17 '19 04:05 vvatanabe

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

vvatanabe avatar May 17 '19 05:05 vvatanabe

Fixed, plz chk it.

vvatanabe avatar May 17 '19 05:05 vvatanabe

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

mcuadros avatar May 27 '19 08:05 mcuadros

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.

vvatanabe avatar May 27 '19 09:05 vvatanabe

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.

filipnavara avatar Oct 05 '19 12:10 filipnavara

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

mcuadros avatar Mar 10 '20 09:03 mcuadros

@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!

saracen avatar Mar 16 '20 01:03 saracen