Re: git pull failure, truncated object
From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:43:09
"Shawn O. Pearce" [off-list ref] wrote:
Don't run git-gc on a repository that is acting strangely, unless you have concluded that the correct course of action is to just repack the repository. (It rarely is, btw.) You could make things worse if a packfile contains a corrupt object and you have the same valid loose object; a gc would delete the valid object and keep the corrupt one.
OK, my statement is a little blown-out-of-proportion. Its pretty hard these days to corrupt an object within a packfile such that we'll be able to reuse it during the repack that goes on in git-gc, but still actually have it be corrupt enough that the object is useless. The recent index version 2 work from Nico makes it even harder, as the index adds an additional checksum over the entire object header and body. But still, even though the risk is pretty small, I think that running a destructive operation like git-gc in a repository that is not acting normally is a bad idea. You should try to diagnose and correct the issue before making further changes (or reorganizations) to that repository's contents. -- Shawn.