From: Shawn O. Pearce Date: Mon, 8 Aug 2011 15:31:30 +0000 (-0700) Subject: Fix jgit rev-list --objects master X-Git-Tag: v1.1.0.201109011030-rc2~25^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F76%2F3976%2F1;p=jgit.git Fix jgit rev-list --objects master This flag was not being honored due to a bug in createWalk(). argWalk is always non-null when there are commits passed in on the command line. If --objects was specified, always make a new ObjectWalk for the actual execution. Change-Id: I6e1a1636f2634605d86671a83766cc1c42939821 Signed-off-by: Shawn O. Pearce --- diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java index 474e974cd1..715cb71b43 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java @@ -199,9 +199,11 @@ abstract class RevWalkTextBuiltin extends TextBuiltin { } protected RevWalk createWalk() { - if (argWalk == null) - argWalk = objects ? new ObjectWalk(db) : new RevWalk(db); - return argWalk; + if (objects) + return new ObjectWalk(db); + if (argWalk != null) + return argWalk; + return new RevWalk(db); } protected int walkLoop() throws Exception {