Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.StoredConfig.save()


    Repository db = null;
    try {
      db = repositoryManager.getRepository(repository.name);
      StoredConfig config = db.getConfig();
      config.unsetSection(MILESTONE, milestone);
      config.save();

      milestonesCache.remove(repository.name);

      return true;
    } catch (IOException e) {
View Full Code Here


      GitConfigSharedRepository sharedRepository = new GitConfigSharedRepository(shared);
      if (sharedRepository.isShared()) {
        StoredConfig config = repo.getConfig();
        config.setString("core", null, "sharedRepository", sharedRepository.getValue());
        config.setBoolean("receive", null, "denyNonFastforwards", true);
        config.save();

        if (! JnaUtils.isWindows()) {
          Iterator<File> iter = org.apache.commons.io.FileUtils.iterateFilesAndDirs(repo.getDirectory(),
              TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
          // Adjust permissions on file/directory
View Full Code Here

      if (invalidSpecs == repairedSpecs && repairedSpecs > 0) {
        // the fetch specs were automatically repaired
        rc.setStringList("remote", name, "fetch", specs);
        try {
          rc.save();
          rc.load();
          LOGGER.debug("repaired {} invalid fetch refspecs for {}", repairedSpecs, repository.getDirectory());
          return true;
        } catch (Exception e) {
          LOGGER.error(null, e);
View Full Code Here

              StoredConfig config = rf.getConfig();
              String origin = config.getString("remote", "origin", "url");
              origin = origin.replace(repositoryName, repository.name);
              config.setString("remote", "origin", "url", origin);
              config.setString(Constants.CONFIG_GITBLIT, null, "originRepository", repository.name);
              config.save();
            } catch (Exception e) {
              logger.error("Failed to update repository fork config for " + fork, e);
            }
            rf.close();
          }
View Full Code Here

        }
      }
    }

    try {
      config.save();
    } catch (IOException e) {
      logger.error("Failed to save repository config!", e);
    }
  }
View Full Code Here

      if (!ArrayUtils.isEmpty(model.postReceiveScripts)) {
        config.setStringList(TEAM, model.name, POSTRECEIVE, model.postReceiveScripts);
      }
    }

    config.save();
    // manually set the forceReload flag because not all JVMs support real
    // millisecond resolution of lastModified. (issue-55)
    forceReload = true;

    // If the write is successful, delete the current file and rename
View Full Code Here

    public static Git addRemote(ProductInstance product, String key, String remoteName, Git git) throws IOException
    {
        StoredConfig config = git.getRepository().getConfig();
        config.setString("remote", remoteName, "url", getGitRepositoryUrl(product, key));
        config.setString("remote", remoteName, "fetch", "+refs/heads/*:refs/remotes/origin/*");
        config.save();
        return git;
    }
}
View Full Code Here

                modifiedConfig = true;
            }

            if(modifiedConfig) {
                try {
                    storedConfig.save();
                   // storedConfig.load();

                } catch (IOException e) {
                    log.error("Error saving git configuration file in local repo at " + gitRepoCtx.getGitLocalRepoPath(), e);
                    e.printStackTrace();
View Full Code Here

      if (!ArrayUtils.isEmpty(model.postReceiveScripts)) {
        config.setStringList(TEAM, model.name, POSTRECEIVE, model.postReceiveScripts);
      }
    }

    config.save();
    // manually set the forceReload flag because not all JVMs support real
    // millisecond resolution of lastModified. (issue-55)
    forceReload = true;

    // If the write is successful, delete the current file and rename
View Full Code Here

      GitConfigSharedRepository sharedRepository = new GitConfigSharedRepository(shared);
      if (sharedRepository.isShared()) {
        StoredConfig config = repo.getConfig();
        config.setString("core", null, "sharedRepository", sharedRepository.getValue());
        config.setBoolean("receive", null, "denyNonFastforwards", true);
        config.save();

        if (! JnaUtils.isWindows()) {
          Iterator<File> iter = org.apache.commons.io.FileUtils.iterateFilesAndDirs(repo.getDirectory(),
              TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
          // Adjust permissions on file/directory
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.