diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2012-06-12 13:56:42 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2012-06-12 13:56:42 +0200 |
commit | 2853c61f12f44bdacac404a58cebd191f98299b1 (patch) | |
tree | 0bfeca5fe7b7566c52dca032f185891225cc2d0e | |
parent | f2d9a5ed31380470aa2b708afc5d1711aa086ca7 (diff) | |
download | jgit-2853c61f12f44bdacac404a58cebd191f98299b1.tar.gz jgit-2853c61f12f44bdacac404a58cebd191f98299b1.zip |
Do not set core.autocrlf when creating repo
core.autorlf defaults to false, but can be set in the user or
"system" config files. Note that EGit/JGit may not know
where the "system" config file is located.
Also fix pgm's ConfigTest which depends on default repository
configuration.
Bug: 382067
Change-Id: I2c698a76e30d968e7f351b4f5a2195f0b124f62f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r-- | org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java | 15 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java index 23dd2600b9..fe423da166 100644 --- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java +++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java @@ -42,7 +42,8 @@ */ package org.eclipse.jgit.pgm; -import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.lib.CLIRepositoryTestCase; @@ -60,11 +61,11 @@ public class ConfigTest extends CLIRepositoryTestCase { @Test public void testListConfig() throws Exception { String[] output = execute("git config --list"); - assertArrayEquals("expected default configuration", // - new String[] { "core.autocrlf=false", // - "core.filemode=true", // - "core.logallrefupdates=true", // - "core.repositoryformatversion=0", // - "" /* ends with LF (last line empty) */}, output); + // value depends on platform + assertTrue(output[0].startsWith("core.filemode=")); + assertTrue(output[0].endsWith("true") || output[0].endsWith("false")); + assertEquals("core.logallrefupdates=true", output[1]); + assertEquals("core.repositoryformatversion=0", output[2]); + assertEquals("", output[3]); /* ends with LF (last line empty) */ } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java index fa87b9f26a..7934e7f9be 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java @@ -280,8 +280,6 @@ public class FileRepository extends Repository { ConfigConstants.CONFIG_KEY_BARE, true); cfg.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_LOGALLREFUPDATES, !bare); - cfg.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null, - ConfigConstants.CONFIG_KEY_AUTOCRLF, false); cfg.save(); } |