From 0bdf030b26248c77806ababd757dad58f1344e57 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Fri, 3 May 2013 11:18:53 -0700 Subject: Require a DiffConfig when creating a FollowFilter The various rename detection options are an inherent part of the filter, similar to the path being followed. This fixes a potential NPE when a RevWalk with a FollowFilter is created without a Repository, since the old code path tried to get the DiffConfig from the RevWalk's possibly-missing repository. Change-Id: Idb273d5a92849b42935ac14eed73b796b80aad50 --- .../tst/org/eclipse/jgit/revwalk/RevWalkFollowFilterTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'org.eclipse.jgit.test') diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFollowFilterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFollowFilterTest.java index 1f70a71a11..05e552e419 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFollowFilterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFollowFilterTest.java @@ -47,8 +47,10 @@ import static org.junit.Assert.assertNull; import java.util.ArrayList; import java.util.List; +import org.eclipse.jgit.diff.DiffConfig; import org.eclipse.jgit.diff.DiffEntry; import org.eclipse.jgit.junit.TestRepository.CommitBuilder; +import org.eclipse.jgit.lib.Config; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -74,7 +76,8 @@ public class RevWalkFollowFilterTest extends RevWalkTestCase { } protected FollowFilter follow(final String followPath) { - FollowFilter followFilter = FollowFilter.create(followPath); + FollowFilter followFilter = + FollowFilter.create(followPath, new Config().get(DiffConfig.KEY)); followFilter.setRenameCallback(diffCollector); rw.setTreeFilter(followFilter); return followFilter; -- cgit v1.2.3