Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.FileBasedConfig.load()


            CLIText.get().configFileNotFound, //
            configFile.getAbsolutePath()));
      }

      FileBasedConfig cfg = new FileBasedConfig(configFile, FS.DETECTED);
      cfg.load();
      new WindowCacheConfig().fromConfig(cfg).install();
      packConfig.fromConfig(cfg);
    }

    int threads = packConfig.getThreads();
View Full Code Here


      // repository and not inherited from other files.
      //
      File path = safeFS().resolve(getGitDir(), Constants.CONFIG);
      FileBasedConfig cfg = new FileBasedConfig(path, safeFS());
      try {
        cfg.load();
      } catch (ConfigInvalidException err) {
        throw new IllegalArgumentException(MessageFormat.format(
            JGitText.get().repositoryConfigFileInvalid, path
                .getAbsolutePath(), err.getMessage()));
      }
View Full Code Here

  private FileBasedConfig configFor(File gitDir) throws IOException,
      ConfigInvalidException {
    File configPath = new File(gitDir, Constants.CONFIG);
    FileBasedConfig cfg = new FileBasedConfig(configPath, FS.DETECTED);
    cfg.load();
    return cfg;
  }

  private void assertGitdirPath(Repository repo, String... expected)
      throws IOException {
View Full Code Here

    // Save path and URL to parent repository's .gitmodules file
    FileBasedConfig modulesConfig = new FileBasedConfig(new File(
        repo.getWorkTree(), Constants.DOT_GIT_MODULES), repo.getFS());
    try {
      modulesConfig.load();
      modulesConfig.setString(ConfigConstants.CONFIG_SUBMODULE_SECTION,
          path, ConfigConstants.CONFIG_KEY_PATH, path);
      modulesConfig.setString(ConfigConstants.CONFIG_SUBMODULE_SECTION,
          path, ConfigConstants.CONFIG_KEY_URL, uri);
      modulesConfig.save();
View Full Code Here

    command.setURI(url2);
    Repository r = command.call();
    assertNotNull(r);
    addRepoToClose(r);

    modulesConfig.load();
    assertEquals(path1, modulesConfig.getString(
        ConfigConstants.CONFIG_SUBMODULE_SECTION, path1,
        ConfigConstants.CONFIG_KEY_PATH));
    assertEquals(url1, modulesConfig.getString(
        ConfigConstants.CONFIG_SUBMODULE_SECTION, path1,
View Full Code Here

        + "  email = A U Thor <thor@example.com> # Just an example...\n"
        + " name = \"A  Thor \\\\ \\\"\\t \"\n"
        + "    defaultCheckInComment = a many line\\n\\\ncomment\\n\\\n"
        + " to test\n";
    write(cfg, configStr);
    c.load();
    assertEquals("yes", c.getString("core", null, "filemode"));
    assertEquals("A U Thor <thor@example.com>", c.getString("user", null,
        "email"));
    assertEquals("A  Thor \\ \"\t ", c.getString("user", null, "name"));
    assertEquals("a many line\ncomment\n to test", c.getString("user",
View Full Code Here

    if (rootTree == null) {
      File modulesFile = new File(repository.getWorkTree(),
          Constants.DOT_GIT_MODULES);
      FileBasedConfig config = new FileBasedConfig(modulesFile,
          repository.getFS());
      config.load();
      modulesConfig = config;
    } else {
      TreeWalk configWalk = new TreeWalk(repository);
      try {
        configWalk.addTree(rootTree);
View Full Code Here

    // TODO: remove usage of internal type
    if (db instanceof FileRepository) {
      FileRepository fr = (FileRepository) db;
      FileBasedConfig config = new FileBasedConfig(fr.getConfig().getFile(), FS.detect());
      try {
        config.load();
      } catch (ConfigInvalidException e) {
        throw new IOException(e);
      }
      return config;
    } else {
View Full Code Here

    }

    FileBasedConfig cfg = new FileBasedConfig(site.gerrit_config, FS.DETECTED);
    FileBasedConfig sec = new FileBasedConfig(site.secure_config, FS.DETECTED);
    cfg.load();
    sec.load();

    assertEquals("email.user", cfg.getString("sendemail", null, "smtpUser"));
    assertNull(cfg.getString("sendemail", null, "smtpPass"));
    assertEquals("email.s3kr3t", sec.getString("sendemail", null, "smtpPass"));
View Full Code Here

      // repository and not inherited from other files.
      //
      File path = safeFS().resolve(getGitDir(), "config");
      FileBasedConfig cfg = new FileBasedConfig(path, safeFS());
      try {
        cfg.load();
      } catch (ConfigInvalidException err) {
        throw new IllegalArgumentException(MessageFormat.format(
            JGitText.get().repositoryConfigFileInvalid, path
                .getAbsolutePath(), err.getMessage()));
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.