diff options
author | Marco Miller <marco.miller@ericsson.com> | 2016-05-06 16:19:42 -0400 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-05-12 00:26:38 +0200 |
commit | 00db4ab06ea5411732ca77cebc823d90cc59e372 (patch) | |
tree | 369b05f17b7a1198933022f87bb12b15619d1a66 /org.eclipse.jgit.test/tst | |
parent | e5a9915a921155ba2f2f7babe5d4aa1abad0000c (diff) | |
download | jgit-00db4ab06ea5411732ca77cebc823d90cc59e372.tar.gz jgit-00db4ab06ea5411732ca77cebc823d90cc59e372.zip |
Fix config value get to return last instead of 1st just like git
Before this fix, getting the value of 'key' below used to return
value1. This fix makes it so that value3 gets returned instead,
just like native git's get.
[section]
key = value1
key = value2
key = value3
Change-Id: Iccb24de9b63c3ad8646c909494ca3f8c9ed6e29c
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java index 6238a354d8..6c6100e116 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java @@ -739,6 +739,12 @@ public class ConfigTest { c.getStringList("a", null, "x")); } + @Test + public void testReadMultipleValuesForName() throws ConfigInvalidException { + Config c = parse("[foo]\nbar=false\nbar=true\n"); + assertTrue(c.getBoolean("foo", "bar", false)); + } + private static void assertReadLong(long exp) throws ConfigInvalidException { assertReadLong(exp, String.valueOf(exp)); } |