summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2011-08-08 08:31:30 -0700
committerShawn O. Pearce <spearce@spearce.org>2011-08-08 08:31:47 -0700
commit489604aaad8ef8d252bf31056db4de01e690fa0b (patch)
treef82d84a2278409cece0dd7bfde41279ae458d71d /org.eclipse.jgit.pgm/src
parent86ecf141b6e94f18702224e60e8992cafe4d02bc (diff)
downloadjgit-489604aaad8ef8d252bf31056db4de01e690fa0b.tar.gz
jgit-489604aaad8ef8d252bf31056db4de01e690fa0b.zip
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 <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.pgm/src')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevWalkTextBuiltin.java8
1 files changed, 5 insertions, 3 deletions
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 {