diff options
author | Dave Borowitz <dborowitz@google.com> | 2013-05-03 11:18:53 -0700 |
---|---|---|
committer | Shawn Pearce <spearce@spearce.org> | 2013-05-05 08:41:09 -0700 |
commit | 0bdf030b26248c77806ababd757dad58f1344e57 (patch) | |
tree | 8427e323090a976f41196cf8705a05259233354e /org.eclipse.jgit.test | |
parent | b8e763fc19fd20d1c846bf538532907cf542ce46 (diff) | |
download | jgit-0bdf030b26248c77806ababd757dad58f1344e57.tar.gz jgit-0bdf030b26248c77806ababd757dad58f1344e57.zip |
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
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkFollowFilterTest.java | 5 |
1 files changed, 4 insertions, 1 deletions
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; |