瀏覽代碼

Ensure the tree parser resets in ObjectWalk

During dispose() or reset() we are suppose to be restoring the
ObjectWalk instance back to the original pre-walk state, but we
failed to reset the tree parser.  This can lead to confusing state
if the ObjectWalk was reused by the caller, as entries from the
old walk might be reported as part of the new walk.

Change-Id: I6237bae7bfd3794e8b9a92b4dd475559cc72e634
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
tags/v0.7.0
Shawn O. Pearce 14 年之前
父節點
當前提交
0d94a5ca66
共有 1 個檔案被更改,包括 2 行新增0 行删除
  1. 2
    0
      org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java

+ 2
- 0
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java 查看文件

@@ -371,6 +371,7 @@ public class ObjectWalk extends RevWalk {
public void dispose() {
super.dispose();
pendingObjects = new BlockObjQueue();
treeWalk = new CanonicalTreeParser();
nextSubtree = null;
currentTree = null;
}
@@ -379,6 +380,7 @@ public class ObjectWalk extends RevWalk {
protected void reset(final int retainFlags) {
super.reset(retainFlags);
pendingObjects = new BlockObjQueue();
treeWalk = new CanonicalTreeParser();
nextSubtree = null;
}


Loading…
取消
儲存