Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.Config$Entry


              bind(File.class) //
                  .annotatedWith(SitePath.class) //
                  .toInstance(new File("."));

              Config cfg = new Config();
              cfg.setString("gerrit", null, "basePath", "git");
              cfg.setString("user", null, "name", "Gerrit Code Review");
              cfg.setString("user", null, "email", "gerrit@localhost");

              bind(Config.class) //
                  .annotatedWith(GerritServerConfig.class) //
                  .toInstance(cfg);
View Full Code Here


    return dc;
  }

  protected Config readConfig(String fileName) throws IOException,
      ConfigInvalidException {
    Config rc = new Config();
    String text = readUTF8(fileName);
    if (!text.isEmpty()) {
      try {
        rc.fromText(text);
      } catch (ConfigInvalidException err) {
        throw new ConfigInvalidException("Invalid config file " + fileName
            + " in commit" + revision.name(), err);
      }
    }
View Full Code Here

  @Override
  protected void onLoad() throws IOException, ConfigInvalidException {
    Map<String, GroupReference> groupsByName = readGroupList();

    rulesId = getObjectId("rules.pl");
    Config rc = readConfig(PROJECT_CONFIG);
    project = new Project(projectName);

    Project p = project;
    p.setDescription(rc.getString(PROJECT, null, KEY_DESCRIPTION));
    if (p.getDescription() == null) {
      p.setDescription("");
    }
    p.setParentName(rc.getString(ACCESS, null, KEY_INHERIT_FROM));

    p.setUseContributorAgreements(getBoolean(rc, RECEIVE, KEY_REQUIRE_CONTRIBUTOR_AGREEMENT, false));
    p.setUseSignedOffBy(getBoolean(rc, RECEIVE, KEY_REQUIRE_SIGNED_OFF_BY, false));
    p.setRequireChangeID(getBoolean(rc, RECEIVE, KEY_REQUIRE_CHANGE_ID, false));
View Full Code Here

      ConfigInvalidException {
    if (commit.getMessage() == null || "".equals(commit.getMessage())) {
      commit.setMessage("Updated project configuration\n");
    }

    Config rc = readConfig(PROJECT_CONFIG);
    Project p = project;

    if (p.getDescription() != null && !p.getDescription().isEmpty()) {
      rc.setString(PROJECT, null, KEY_DESCRIPTION, p.getDescription());
    } else {
      rc.unset(PROJECT, null, KEY_DESCRIPTION);
    }
    set(rc, ACCESS, null, KEY_INHERIT_FROM, p.getParentName());

    set(rc, RECEIVE, null, KEY_REQUIRE_CONTRIBUTOR_AGREEMENT, p.isUseContributorAgreements());
    set(rc, RECEIVE, null, KEY_REQUIRE_SIGNED_OFF_BY, p.isUseSignedOffBy());
View Full Code Here

                throw new FormException(hudson.plugins.git.Messages.GitSCM_Repository_MissedRepositoryExceptionMsg(),
                    "git.repo.url");
            }
            List<RemoteConfig> remoteRepositories = new ArrayList<RemoteConfig>();
            if (!GitUtils.isEmpty(urls)) {
                Config repoConfig = new Config();
                // Make up a repo config from the request parameters
                repoNames = GitUtils.fixupNames(repoNames, urls);
                if (repoNames != null) {
                    for (int i = 0; i < repoNames.length; i++) {
                        String name = StringUtils.replaceChars(repoNames[i], ' ', '_');
                        if (StringUtils.isEmpty(refSpecs[i])) {
                            refSpecs[i] = "+refs/heads/*:refs/remotes/" + name + "/*";
                        }
                        repoConfig.setString("remote", name, "url", urls[i]);
                        repoConfig.setString("remote", name, "fetch", refSpecs[i]);
                        repoConfig.setString(GitRepository.REMOTE_SECTION, name,
                            GitRepository.TARGET_DIR_KEY, relativeTargetDirs[i]);
                    }
                }
                try {
                    remoteRepositories = GitRepository.getAllGitRepositories(repoConfig);
View Full Code Here

            throws IOException, ServletException {
            if (StringUtils.isEmpty(value)) {
                return FormValidation.error(
                    hudson.plugins.git.Messages.GitSCM_Repository_IncorrectRepositoryFormatMsg());
            }
            Config repoConfig = new Config();
            repoConfig.setString("remote", GitUtils.DEFAULD_REPO_NAME, "url", value);
            try {
                RemoteConfig.getAllRemoteConfigs(repoConfig);
            } catch (Exception e) {
                return FormValidation.error(
                    hudson.plugins.git.Messages.GitSCM_Repository_IncorrectRepositoryFormatMsg() + ": "
View Full Code Here

        return pollChangesResult ? PollingResult.SIGNIFICANT : PollingResult.NO_CHANGES;
    }

    private RemoteConfig newRemoteConfig(String name, String refUrl, RefSpec refSpec, String relativeTargetDir) {
        try {
            Config repoConfig = new Config();
            // Make up a repo config from the request parameters
            repoConfig.setString(GitRepository.REMOTE_SECTION, name, "url", refUrl);
            repoConfig.setString(GitRepository.REMOTE_SECTION, name, "fetch", refSpec.toString());
            repoConfig.setString(GitRepository.REMOTE_SECTION, name, GitRepository.TARGET_DIR_KEY, relativeTargetDir);
            return GitRepository.getAllGitRepositories(repoConfig).get(0);
        } catch (Exception ex) {
            throw new GitException("Remote's configuration is invalid", ex);
        }
    }
View Full Code Here

        this.expectedResult = expectedResult;
    }

    @Before
    public void setUp() throws URISyntaxException, MalformedURLException {
        Config config = new Config();
        config.setString(GitRepository.REMOTE_SECTION, "name", "url", "http://git.com");
        config.setString(GitRepository.REMOTE_SECTION, "name", "fetch", "refSpec1");
        repos = GitRepository.getAllGitRepositories(config);
        Collection<SubmoduleConfig> configs = new ArrayList<SubmoduleConfig>();
        SubmoduleConfig submoduleConfig = new SubmoduleConfig();
        submoduleConfig.setSubmoduleName("submoduleName");
        configs.add(submoduleConfig);
View Full Code Here


    @Parameterized.Parameters
    public static Collection generateData() throws MalformedURLException, URISyntaxException {

        Config config = new Config();
        config.setString(GitRepository.REMOTE_SECTION, "name", "url", "http://git.com");
        config.setString(GitRepository.REMOTE_SECTION, "name", "fetch", "refSpec1");
        List<RemoteConfig> repos = GitRepository.getAllGitRepositories(config);

        config = new Config();
        config.setString(GitRepository.REMOTE_SECTION, "name1", "url", "http://git.com");
        config.setString(GitRepository.REMOTE_SECTION, "name1", "fetch", "refSpec1");
        List<RemoteConfig> repos1 = GitRepository.getAllGitRepositories(config);

        List<BranchSpec> branches = GitSCM.DescriptorImpl.createBranches(new String[]{"master"});
        GitRepositoryBrowser browser = new GithubWeb("http://git.com");
        BuildChooser buildChooser = new DefaultBuildChooser();
View Full Code Here

    private GitRepository repo2;
    private GitRepository repo3;

    @Before
    public void setUp() throws URISyntaxException {
        Config config = new Config();

        config.setString(GitRepository.REMOTE_SECTION, "name1", "url", "http://git1.com");
        config.setString(GitRepository.REMOTE_SECTION, "name1", "fetch", "refSpec1");
        config.setString(GitRepository.REMOTE_SECTION, "name1", GitRepository.TARGET_DIR_KEY, "dir");

        config.setString(GitRepository.REMOTE_SECTION, "name2", "url", "http://git2.com");
        config.setString(GitRepository.REMOTE_SECTION, "name2", "fetch", "refSpec2");
        config.setString(GitRepository.REMOTE_SECTION, "name2", GitRepository.TARGET_DIR_KEY, "dir2");

        repo1 = new GitRepository(config, "name1");
        repo2 = new GitRepository(config, "name1");
        repo3 = new GitRepository(config, "name2");
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.Config$Entry

Copyright © 2018 www.massapicom. 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.