Package org.eclipse.egit.core

Examples of org.eclipse.egit.core.RepositoryCache


    if (userConfig == null)
      userConfig = SystemReader.getInstance().openUserConfig(null, FS.DETECTED); // no inherit here!
    if (repositories == null) {
      repositories = new ArrayList<Repository>();
      List<String> repoPaths = Activator.getDefault().getRepositoryUtil().getConfiguredRepositories();
      RepositoryCache repositoryCache = org.eclipse.egit.core.Activator.getDefault().getRepositoryCache();
      for (String repoPath : repoPaths) {
        File gitDir = new File(repoPath);
        if (!gitDir.exists())
          continue;
        try {
          repositories.add(repositoryCache.lookupRepository(gitDir));
        } catch (IOException e) {
          continue;
        }
      }
      sortRepositoriesByName();
View Full Code Here


  public static void afterClassBase() throws Exception {
    testUtils.deleteTempDirs();
  }

  protected static void shutDownRepositories() {
    RepositoryCache cache = Activator.getDefault().getRepositoryCache();
    for(Repository repository:cache.getAllRepositories())
      repository.close();
    cache.clear();
  }
View Full Code Here

    private RepositoryCommit searchCommit() throws IOException {
      RepositoryUtil repositoryUtil = Activator.getDefault()
          .getRepositoryUtil();
      List<String> configuredRepositories = repositoryUtil
          .getConfiguredRepositories();
      RepositoryCache repositoryCache = Activator.getDefault()
          .getRepositoryCache();
      for (String repoDir : configuredRepositories) {
        Repository repository = repositoryCache
            .lookupRepository(new File(repoDir));
        RevCommit commit = getCommit(repository);
        if (commit != null)
          return new RepositoryCommit(repository, commit);
      }
View Full Code Here

    SubmoduleWalk walk = SubmoduleWalk.forIndex(repo);
    try {
      while (walk.next()) {
        Repository subRepo = walk.getRepository();
        if (subRepo != null) {
          RepositoryCache cache = null;
          try {
            cache = org.eclipse.egit.core.Activator.getDefault()
                .getRepositoryCache();
          } finally {
            if (cache != null)
              cache.lookupRepository(subRepo.getDirectory())
                  .close();
            subRepo.close();
          }
        }
      }
View Full Code Here

   * @return a map containing a list of repository relative paths for each
   *         occurring repository
   */
  public static Map<Repository, Collection<String>> splitPathsByRepository(
      Collection<IPath> paths) {
    RepositoryCache repositoryCache = Activator.getDefault()
        .getRepositoryCache();
    Map<Repository, Collection<String>> result = new HashMap<Repository, Collection<String>>();
    for (IPath path : paths) {
      Repository repository = repositoryCache.getRepository(path);
      if (repository != null) {
        IPath repoPath = new Path(repository.getWorkTree()
            .getAbsolutePath());
        IPath repoRelativePath = path.makeRelativeTo(repoPath);
        addPathToMap(repository, repoRelativePath.toString(), result);
View Full Code Here

    @Override
    protected IStatus run(IProgressMonitor monitor) {
      // The core plugin might have been stopped before we could cancel
      // this job.
      RepositoryCache repositoryCache = org.eclipse.egit.core.Activator
          .getDefault().getRepositoryCache();
      if (repositoryCache == null)
        return Status.OK_STATUS;

      Repository[] repos = repositoryCache.getAllRepositories();
      if (repos.length == 0)
        return Status.OK_STATUS;

      // When people use Git from the command line a lot of changes
      // may happen. Don't scan when inactive depending on the user's
View Full Code Here

TOP

Related Classes of org.eclipse.egit.core.RepositoryCache

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.