]> source.dussan.org Git - jgit.git/commitdiff
Fix jgit rev-list --objects master 76/3976/1
authorShawn O. Pearce <spearce@spearce.org>
Mon, 8 Aug 2011 15:31:30 +0000 (08:31 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 8 Aug 2011 15:31:47 +0000 (08:31 -0700)
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 <spearce@spearce.org>
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java

index 474e974cd1e84a62c8e1131405066f406f234e1c..715cb71b43591a343543d47b8ba494ec0eb589a6 100644 (file)
@@ -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 {