aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule
diff options
context:
space:
mode:
authorJonathan Nieder <jrn@google.com>2015-06-10 14:48:21 -0700
committerJonathan Nieder <jrn@google.com>2015-06-10 14:48:21 -0700
commita1fd4980dfa302f4b14b64d2b2fa0d9b86a8e742 (patch)
tree5021f0c8876e32ab49017afacb7cfc3c39a82552 /org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule
parent2508f1695f38e450ed320bafdd6b94fedabf116d (diff)
downloadjgit-a1fd4980dfa302f4b14b64d2b2fa0d9b86a8e742.tar.gz
jgit-a1fd4980dfa302f4b14b64d2b2fa0d9b86a8e742.zip
submodule test: Use config.unset instead of setting to null
Most relative-URL tests for SubmoduleInitCommand carry out the following steps: 1. add a submodule at path "sub" to the index 2. set remote.origin.url in .git/config 3. configure .gitmodules, possibly using relative URLs, and see what happens resolveWorkingDirectoryRelativeUrl() is meant to test the fallback when remote.origin.url is not set, to match C git which treats the URL as relative to the cwd in that case. To do so, in step (2) it sets remote.origin.url to null. However, Config.setString when taking a null value does not actually unset that value from the configuration --- it sets it to the empty string. This means we are testing a behavior that C git never supported. Use Config.unset instead. Change-Id: I7af29fbbd333a2598843d62c320093c48b2ad972 Signed-off-by: Jonathan Nieder <jrn@google.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleInitTest.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleInitTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleInitTest.java
index 22e55fe729..2b46498470 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleInitTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleInitTest.java
@@ -246,9 +246,8 @@ public class SubmoduleInitTest extends RepositoryTestCase {
if (File.separatorChar == '\\')
base = base.replace('\\', '/');
FileBasedConfig config = db.getConfig();
- config.setString(ConfigConstants.CONFIG_REMOTE_SECTION,
- Constants.DEFAULT_REMOTE_NAME, ConfigConstants.CONFIG_KEY_URL,
- null);
+ config.unset(ConfigConstants.CONFIG_REMOTE_SECTION,
+ Constants.DEFAULT_REMOTE_NAME, ConfigConstants.CONFIG_KEY_URL);
config.save();
SubmoduleWalk generator = SubmoduleWalk.forIndex(db);