Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] RevWalk problems with shallow clones

On 11.08.2011 19:05, Shawn Pearce wrote:
> On Thu, Aug 4, 2011 at 03:36, Marc Strapetz <marc.strapetz@xxxxxxxxxxx> wrote:
>> A RevWalk on a repository which had been cloned with --depth flag
>> results in following stack trace. I'm wondering if PendingGenerator
>> could be more tolerant if told so by some kind of flag? The flag would
>> probably be set when .git/shallow exists.
> 
> Right, we have not yet implemented shallow client support in JGit.
> 
> The way to do handle the shallow stuff is to actually insert
> pre-parsed RevCommit objects into the RevWalk object pool that have
> the parents truncated away, similar to a graft (which we also don't
> support). This will keep JGit from walking backwards into the commits
> it doesn't have, and thus avoid the MissingObjectException you noted.

I've uploaded a patch for this, which works well with my shallow test
repositories:

https://git.eclipse.org/r/#/c/8345/

-Marc


Back to the top