Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

could not get blob from packfiles #1153

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

vvatanabe
Copy link

fixes by #1149

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

…-d#1149

Signed-off-by: Yuichi Watanabe <yuichi.watanabe.ja@gmail.com>
@vvatanabe
Copy link
Author

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

…rc-d#1149

Signed-off-by: Yuichi Watanabe <yuichi.watanabe.ja@gmail.com>
…e prefix and suffix. Fixes src-d#1149

Signed-off-by: Yuichi Watanabe <yuichi.watanabe.ja@gmail.com>
@vvatanabe
Copy link
Author

Fixed, plz chk it.

@mcuadros
Copy link
Contributor

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

@vvatanabe
Copy link
Author

vvatanabe commented May 27, 2019

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.

Copy link
Contributor

@jfontan jfontan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcuadros this fix makes it skip dangling tmp files that is the correct behavior.

@filipnavara
Copy link
Contributor

Related: #1223. As I mentioned in #1149 (comment) 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
Copy link
Contributor

Merged in go-git/go-git#6

@saracen
Copy link
Contributor

saracen commented Mar 16, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants