You can query/set options with this command. The name is actually the section and key separated by a dot.
Global options are usually stored in ~/.geogigconfig. Repository options will be stored in repo/.geogig/config @see ConfigDatabase
164165166167168169170171172173174
.setValue(null).call(); } @Test public void testEmptyNameAndValueForGet() { final ConfigOp config = geogig.command(ConfigOp.class); exception.expect(ConfigException.class); config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_GET).setName("") .setValue("").call(); }
173174175176177178179180181182183
.setValue("").call(); } @Test public void testEmptyNameAndValueForSet() { final ConfigOp config = geogig.command(ConfigOp.class); exception.expect(ConfigException.class); config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_SET).setName("") .setValue("").call(); }
182183184185186187188189190191192
.setValue("").call(); } @Test public void testEmptyNameForUnset() { final ConfigOp config = geogig.command(ConfigOp.class); exception.expect(ConfigException.class); config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_UNSET).setName("") .setValue(null).call(); }
191192193194195196197198199200201
.setValue(null).call(); } @Test public void testEmptyNameForRemoveSection() { final ConfigOp config = geogig.command(ConfigOp.class); exception.expect(ConfigException.class); config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_REMOVE_SECTION) .setName("").call(); }
200201202203204205206207208209210
.setName("").call(); } @Test public void testNoNameForSet() { final ConfigOp config = geogig.command(ConfigOp.class); exception.expect(ConfigException.class); config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_SET).setName(null) .setValue(null).call(); }
209210211212213214215216217218219
.setValue(null).call(); } @Test public void testNoNameForUnset() { final ConfigOp config = geogig.command(ConfigOp.class); exception.expect(ConfigException.class); config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_UNSET).setName(null) .setValue(null).call(); }
218219220221222223224225226227228
.setValue(null).call(); } @Test public void testNoNameForRemoveSection() { final ConfigOp config = geogig.command(ConfigOp.class); exception.expect(ConfigException.class); config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_REMOVE_SECTION) .setName(null).setValue(null).call(); }
227228229230231232233234235236237
.setName(null).setValue(null).call(); } @Test public void testRemovingMissingSection() { final ConfigOp config = geogig.command(ConfigOp.class); exception.expect(ConfigException.class); config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_REMOVE_SECTION) .setName("unusedsectionname").setValue(null).call(); }
236237238239240241242243244245
.setName("unusedsectionname").setValue(null).call(); } @Test public void testInvalidSectionKey() { final ConfigOp config = geogig.command(ConfigOp.class); Optional<Map<String, String>> result = config.setScope(ConfigScope.GLOBAL) .setAction(ConfigAction.CONFIG_GET).setName("doesnt.exist").setValue(null).call(); assertFalse(result.isPresent()); }
244245246247248249250251252253254
assertFalse(result.isPresent()); } @Test public void testTooManyArguments() { final ConfigOp config = geogig.command(ConfigOp.class); exception.expect(ConfigException.class); config.setScope(ConfigScope.GLOBAL).setAction(ConfigAction.CONFIG_GET).setName("too.many") .setValue("arguments").call(); }