From 489604aaad8ef8d252bf31056db4de01e690fa0b Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Mon, 8 Aug 2011 08:31:30 -0700 Subject: 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 --- .../src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'org.eclipse.jgit.pgm') 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 { -- cgit v1.2.3