Re: Tree with leading '0' modes in 1.7.0.3
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Mar 26, 2010, 23:05 UTC
- Message-ID
- <20100326230537.GC10910@spearce.org>
- In-Reply-To
- <4BAD3C6E.4090604@gmail.com>
"Mike.lifeguard" <mike.lifeguard@gmail.com> wrote:
Show 5 quoted lines
> Apparently Scott Chacon has some clue about this error: > http://support.github.com/discussions/repos/2566-strange-warning-from-fsck-and-github-repo-using-too-much-diskspace > so I've added him to CC. (Note that changing all SHA1s is not really a > problem for us, there are only 3 copies of the repo, and the project has > only been using version control for 2 days)
Scott, please fix that library on GitHub. JGit's fsck has a hard failure on these malformed trees, because the leading '0' mode causes the tree to come up with the wrong SHA-1 hash given its logical content. They shouldn't be created like this.
Mike, it sounds like you might be able to fix your project by just running something like:
$ git filter-branch --index-filter '' --all
It rewrites the trees, which will change their SHA-1s (and the commit SHA-1s downstream from there) with correctly formatted tree objects.
-- Shawn.