Package org.eclipse.jgit.lib

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


        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

    private PreBuildMergeOptions options1 = new PreBuildMergeOptions();
    private PreBuildMergeOptions options2 = new PreBuildMergeOptions();

    @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, "name2", "url", "http://git2.com");
        config.setString(GitRepository.REMOTE_SECTION, "name2", "fetch", "refSpec2");
        remoteConfigs = GitRepository.getAllGitRepositories(config);
        config = new Config();
        config.setString(GitRepository.REMOTE_SECTION, "name1", "url", "http://git1.com");
        config.setString(GitRepository.REMOTE_SECTION, "name1", "fetch", "refSpec1");
        remoteConfigs.addAll(GitRepository.getAllGitRepositories(config));
    }
View Full Code Here

          JGitText.get().cannotPullOnARepoWithState, repo
              .getRepositoryState().name()));

    // get the configured remote for the currently checked out branch
    // stored in configuration key branch.<branch name>.remote
    Config repoConfig = repo.getConfig();
    String remote = repoConfig.getString(
        ConfigConstants.CONFIG_BRANCH_SECTION, branchName,
        ConfigConstants.CONFIG_KEY_REMOTE);
    if (remote == null)
      // fall back to default remote
      remote = Constants.DEFAULT_REMOTE_NAME;

    // get the name of the branch in the remote repository
    // stored in configuration key branch.<branch name>.merge
    String remoteBranchName = repoConfig.getString(
        ConfigConstants.CONFIG_BRANCH_SECTION, branchName,
        ConfigConstants.CONFIG_KEY_MERGE);
    // check if the branch is configured for pull-rebase
    boolean doRebase = repoConfig.getBoolean(
        ConfigConstants.CONFIG_BRANCH_SECTION, branchName,
        ConfigConstants.CONFIG_KEY_REBASE, false);

    if (remoteBranchName == null) {
      String missingKey = ConfigConstants.CONFIG_BRANCH_SECTION + DOT
          + branchName + DOT + ConfigConstants.CONFIG_KEY_MERGE;
      throw new InvalidConfigurationException(MessageFormat.format(
          JGitText.get().missingConfigurationForKey, missingKey));
    }

    final boolean isRemote = !remote.equals(".");
    String remoteUri;
    FetchResult fetchRes;
    if (isRemote) {
      remoteUri = repoConfig.getString("remote", remote,
          ConfigConstants.CONFIG_KEY_URL);
      if (remoteUri == null) {
        String missingKey = ConfigConstants.CONFIG_REMOTE_SECTION + DOT
            + remote + DOT + ConfigConstants.CONFIG_KEY_URL;
        throw new InvalidConfigurationException(MessageFormat.format(
View Full Code Here

        }
      }

      if (addGitFlow) {
        // insert a .gitflow file
        Config config = new Config();
        config.setString("gitflow", null, "masterBranch", Constants.MASTER);
        config.setString("gitflow", null, "developBranch", Constants.DEVELOP);
        config.setString("gitflow", null, "featureBranchPrefix", "feature/");
        config.setString("gitflow", null, "releaseBranchPrefix", "release/");
        config.setString("gitflow", null, "hotfixBranchPrefix", "hotfix/");
        config.setString("gitflow", null, "supportBranchPrefix", "support/");
        config.setString("gitflow", null, "versionTagPrefix", "");

        byte [] bytes = config.toText().getBytes(Constants.ENCODING);

        DirCacheEntry entry = new DirCacheEntry(".gitflow");
        entry.setLength(bytes.length);
        entry.setLastModified(System.currentTimeMillis());
        entry.setFileMode(FileMode.REGULAR_FILE);
View Full Code Here

      postBuffer = rc.getInt("http", "postbuffer", 1 * 1024 * 1024); //$NON-NLS-1$  //$NON-NLS-2$
      sslVerify = rc.getBoolean("http", "sslVerify", true); //$NON-NLS-1$ //$NON-NLS-2$
    }

    private HttpConfig() {
      this(new Config());
    }
View Full Code Here

    return s > 0 ? path.substring(0, s) : "";
  }

  public class FakeTreeIterator extends WorkingTreeIterator {
    public FakeTreeIterator(String pathName, FileMode fileMode) {
      super(prefix(pathName), new Config().get(WorkingTreeOptions.KEY));
      mode = fileMode.getBits();

      final int s = pathName.lastIndexOf('/');
      final byte[] name = Constants.encode(pathName.substring(s + 1));
      ensurePathCapacity(pathOffset + name.length, pathOffset);
View Full Code Here

    if (!repo.getRepositoryState().equals(RepositoryState.SAFE))
      throw new WrongRepositoryStateException(MessageFormat.format(
          JGitText.get().cannotPullOnARepoWithState, repo
              .getRepositoryState().name()));

    Config repoConfig = repo.getConfig();
    if (remote == null) {
      // get the configured remote for the currently checked out branch
      // stored in configuration key branch.<branch name>.remote
      remote = repoConfig.getString(
          ConfigConstants.CONFIG_BRANCH_SECTION, branchName,
          ConfigConstants.CONFIG_KEY_REMOTE);
    }
    if (remote == null)
      // fall back to default remote
      remote = Constants.DEFAULT_REMOTE_NAME;

    if (remoteBranchName == null)
      // get the name of the branch in the remote repository
      // stored in configuration key branch.<branch name>.merge
      remoteBranchName = repoConfig.getString(
          ConfigConstants.CONFIG_BRANCH_SECTION, branchName,
          ConfigConstants.CONFIG_KEY_MERGE);

    // determines whether rebase should be used after fetching
    if (pullRebaseMode == null) {
      pullRebaseMode = getRebaseMode(branchName, repoConfig);
    }

    if (remoteBranchName == null)
      remoteBranchName = branchName;

    final boolean isRemote = !remote.equals("."); //$NON-NLS-1$
    String remoteUri;
    FetchResult fetchRes;
    if (isRemote) {
      remoteUri = repoConfig.getString(
          ConfigConstants.CONFIG_REMOTE_SECTION, remote,
          ConfigConstants.CONFIG_KEY_URL);
      if (remoteUri == null) {
        String missingKey = ConfigConstants.CONFIG_REMOTE_SECTION + DOT
            + remote + DOT + ConfigConstants.CONFIG_KEY_URL;
View Full Code Here

    this.modTimes = modTimes;
  }

  public FileTreeIteratorWithTimeControl(File f, FS fs,
      TreeSet<Long> modTimes) {
    super(f, fs, new Config().get(WorkingTreeOptions.KEY));
    this.modTimes = modTimes;
  }
View Full Code Here

TOP

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

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.