diff options
author | Matthias Sohn | 2014-04-14 20:07:35 +0000 |
---|---|---|
committer | Matthias Sohn | 2014-04-16 13:34:48 +0000 |
commit | 3818190082ee2e17e9ea5b1ff6823494dac0352c (patch) | |
tree | 324abad151b6fa60a702dada0d1ea642b960e296 /org.eclipse.egit.core.test/src | |
parent | abd3f86e0f5fb7039d5f90eb6296ac6865f1e242 (diff) | |
download | egit-3818190082ee2e17e9ea5b1ff6823494dac0352c.tar.gz egit-3818190082ee2e17e9ea5b1ff6823494dac0352c.tar.xz egit-3818190082ee2e17e9ea5b1ff6823494dac0352c.zip |
Use correct syntax for auto ignoring directories
Ignore patterns for ignoring directories should end with a trailing
slash.
Bug: 410872
Change-Id: Ie9cef9d0ee875540af15130f2ca72e5b5163bd2c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.core.test/src')
-rw-r--r-- | org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/IgnoreOperationTest.java | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/IgnoreOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/IgnoreOperationTest.java index e037a0cfd1..cc74ee7509 100644 --- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/IgnoreOperationTest.java +++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/IgnoreOperationTest.java @@ -72,7 +72,16 @@ public class IgnoreOperationTest extends GitTestCase { IgnoreOperation operation = executeIgnore(binFolder.getLocation()); String content = project.getFileContent(Constants.GITIGNORE_FILENAME); - assertEquals("/bin\n", content); + assertEquals("/bin/\n", content); + assertFalse(operation.isGitignoreOutsideWSChanged()); + } + + @Test + public void testIgnoreFile() throws Exception { + IFile aFile = project.createFile("aFile.txt", new byte[0]); + IgnoreOperation operation = executeIgnore(aFile.getLocation()); + String content = project.getFileContent(Constants.GITIGNORE_FILENAME); + assertEquals("/aFile.txt\n", content); assertFalse(operation.isGitignoreOutsideWSChanged()); } @@ -97,19 +106,19 @@ public class IgnoreOperationTest extends GitTestCase { } @Test - public void testIgnoreMultiFile() throws Exception { + public void testIgnoreMultiFolders() throws Exception { project.createSourceFolder(); IFolder binFolder = project.getProject().getFolder("bin"); IFolder srcFolder = project.getProject().getFolder("src"); executeIgnore(binFolder.getLocation()); String content = project.getFileContent(Constants.GITIGNORE_FILENAME); - assertEquals("/bin\n", content); + assertEquals("/bin/\n", content); executeIgnore(srcFolder.getLocation()); content = project.getFileContent(Constants.GITIGNORE_FILENAME); - assertEquals("/bin\n/src\n", content); + assertEquals("/bin/\n/src/\n", content); } @Test @@ -122,7 +131,7 @@ public class IgnoreOperationTest extends GitTestCase { File ignoreFile = new File(rootFile, Constants.GITIGNORE_FILENAME); String content = testUtils.slurpAndClose(ignoreFile.toURI().toURL() .openStream()); - assertEquals("/" + project.getProject().getName() + "\n", content); + assertEquals("/" + project.getProject().getName() + "/\n", content); assertTrue(operation.isGitignoreOutsideWSChanged()); } @@ -139,7 +148,7 @@ public class IgnoreOperationTest extends GitTestCase { IgnoreOperation operation = executeIgnore(binFolder.getLocation()); String content = project.getFileContent(Constants.GITIGNORE_FILENAME); - assertEquals(existing + "\n/bin\n", content); + assertEquals(existing + "\n/bin/\n", content); assertFalse(operation.isGitignoreOutsideWSChanged()); } @@ -151,7 +160,7 @@ public class IgnoreOperationTest extends GitTestCase { operation.execute(new NullProgressMonitor()); String content = project.getFileContent(Constants.GITIGNORE_FILENAME); - assertEquals("/bin\n", content); + assertEquals("/bin/\n", content); } @Test |