Package org.eclipse.jgit.storage.file

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


    LockFile lf = new LockFile(file, fs);
    if (!lf.lock())
      throw new IOException(MessageFormat.format(IpLogText.get().cannotLock, file));
    try {
      FileBasedConfig cfg = new FileBasedConfig(file, fs);
      cfg.load();
      loadFrom(cfg);

      IPZillaQuery ipzilla = new IPZillaQuery(base, username, password);
      Set<CQ> current = ipzilla.getCQs(projects);
View Full Code Here


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

      FileBasedConfig cfg = new FileBasedConfig(configFile, FS.DETECTED);
      cfg.load();

      WindowCacheConfig wcc = new WindowCacheConfig();
      wcc.fromConfig(cfg);
      WindowCache.reconfigure(wcc);
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

      @Override
      protected byte[] readFully() throws IOException {
        return submodulesConfig;
      }
    };
    config.load();
    setModulesConfig(config);
    return this;
  }
}
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

    if (modulesConfig == null) {
      File modulesFile = new File(repository.getWorkTree(),
          Constants.DOT_GIT_MODULES);
      FileBasedConfig config = new FileBasedConfig(modulesFile,
          repository.getFS());
      config.load();
      modulesConfig = config;
    }
  }

  /**
 
View Full Code Here

    String newUri = "git://server/repo.git";
    File modulesFile = new File(repo.getWorkTree(),
        Constants.DOT_GIT_MODULES);
    FileBasedConfig config = new FileBasedConfig(modulesFile, repo.getFS());
    config.load();
    config.setString(ConfigConstants.CONFIG_SUBMODULE_SECTION, path,
        ConfigConstants.CONFIG_KEY_URL, newUri);
    config.save();

    assertEquals(
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

      // 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

    // 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

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.