Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] ObjectWalk works only with "self created commit object's"

Hi all,

ObjectWalk does not contains any elements when in markStart() method
we use RevCommit object that was created by another walker eg.
RevWalk.

Example code:

RevWalk rw = new RevWalk(repo);
RevCommit rwCommit = rw.lookupCommit(commitId);

ObjectWalk ow = new ObjectWalk(repo);
RevCommit owCommit = ow.lookupCommit(commitId);

ow.markStart(rwCommit);

if (ow.next())
    System.out.println("rwCommit: OK");

ow.reset();
ow.markStart(owCommit)

if (ow.next())
    System.out.println("owCommit: OK");


This (pseudo)code will return only: owCommit OK. Additionally
rwCommit.equals(owCommit) will return false, but both commit objects
has same SHA-1 id. This seams to be an incorrect behavior ... or I'm
missing something here.


-- 
Best regards

GSM: +48 695 192 160
Blog: http://luksza.org
LinkedIn: http://www.linkedin.com/in/dariuszluksza


Back to the top