aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorRobin Stocker <robin@nibor.org>2013-08-28 22:57:37 +0200
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2013-09-09 17:05:17 -0400
commit52ab578cd7180d114e01f5c3584424537e3440e3 (patch)
treea8df0658ee8d25559639e2207142483ccb6ccc13 /org.eclipse.jgit.test
parente10dd22749a19bdc61306895f9fbbf1f74bc6ba5 (diff)
downloadjgit-52ab578cd7180d114e01f5c3584424537e3440e3.tar.gz
jgit-52ab578cd7180d114e01f5c3584424537e3440e3.zip
Don't treat "/" as valid ignore pattern
This matches the behavior of C Git. Bug: 415767 Change-Id: Ifa6500f3f6a033da40c48287630b77c47b15f4a0 Signed-off-by: Robin Stocker <robin@nibor.org>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/ignore/IgnoreNodeTest.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/ignore/IgnoreNodeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/ignore/IgnoreNodeTest.java
index 881b01c312..0076ba124d 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/ignore/IgnoreNodeTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/ignore/IgnoreNodeTest.java
@@ -166,6 +166,17 @@ public class IgnoreNodeTest extends RepositoryTestCase {
assertEntry(F, tracked, "src/a/b");
}
+ @Test
+ public void testNoPatterns() throws IOException {
+ writeIgnoreFile(".gitignore", "", " ", "# comment", "/");
+ writeTrashFile("a/a", "");
+
+ beginWalk();
+ assertEntry(F, tracked, ".gitignore");
+ assertEntry(D, tracked, "a");
+ assertEntry(F, tracked, "a/a");
+ }
+
private void beginWalk() throws CorruptObjectException {
walk = new TreeWalk(db);
walk.addTree(new FileTreeIterator(db));