tags:

views:

817

answers:

2

When running get svn fetch to pull the latest new branches from the upstream svn repository I got this error:

$ git svn fetch
fatal: failed to unpack tree object 5ecb324e8b8fcb918acb253f33edc6ce49e49e0d
read-tree 5ecb324e8b8fcb918acb253f33edc6ce49e49e0d: command returned error: 128

Now every attempt at git svn on that local repo results in the same error. Originally I was running git version 1.5.6.4_0 and after the error I tried updating to 1.6.0.2_2 and the problem still persists.

Is there any way to clean up this corruption? A fresh git svn clone of the upstream repository is fine, but I'd like to preserve my existing setup. I've looked through the docs and googled for the problem with no luck.

+1  A: 

The most likely cause for this is a file or commit (that the tree references) is corrupted or missing. Or the tree itself could be corrupted. Check with:

git fsck --unreachable HEAD $(cat .git/refs/heads/*)

This will show a bunch of "dangling" files, which you don't care about; corrupted files will report "Invalid SHA1" or some such thing. I don't know how a missing file would report. Remove any corrupt items and rsync from your upstream repo to replace them.

Paul
Thanks for the info. Unfortunately, no corrupt files showing up, just a handful of unreachable trees/commits/blobs.Using git as a front end to a svn repo I don't have an upstream git to rsync with for recovery. I tried rsync from the fresh git svn clone, but lost all my local branches.
notascleveras
There was a report in the newsgroup (or maybe the mailing list) 2 to 3 months ago of someone having a similar problem which went away when they repacked their repo. I haven't been able to find the report, which probably means it wasn't exactly the same error messages.
Paul
I just tried repacking. No luck. For now I'm moving on to the fresh git svn clone. Thanks for the suggestions.
notascleveras
A: 

I got exactly the same problem. So far only "git svn fetch" has this error. "git svn rebase" is running correctly. Running "git fsck --full" found no error.

Lei