Search in sources :

Example 6 with RepositoryCache

use of org.eclipse.egit.core.RepositoryCache in project egit by eclipse.

the class GitProjectSetCapabilityTest method shutDownRepositories.

protected static void shutDownRepositories() {
    RepositoryCache cache = Activator.getDefault().getRepositoryCache();
    for (Repository repository : cache.getAllRepositories()) {
        repository.close();
    }
    cache.clear();
}
Also used : Repository(org.eclipse.jgit.lib.Repository) RepositoryCache(org.eclipse.egit.core.RepositoryCache)

Example 7 with RepositoryCache

use of org.eclipse.egit.core.RepositoryCache in project egit by eclipse.

the class LocalRepositoryTestCase method shutDownRepositories.

protected static void shutDownRepositories() throws Exception {
    RepositoryCache cache = Activator.getDefault().getRepositoryCache();
    for (Repository repository : cache.getAllRepositories()) repository.close();
    cache.clear();
    IEclipsePreferences prefs = Activator.getDefault().getRepositoryUtil().getPreferences();
    synchronized (prefs) {
        prefs.put(RepositoryUtil.PREFS_DIRECTORIES, "");
        prefs.put(RepositoryUtil.PREFS_DIRECTORIES_REL, "");
        prefs.flush();
    }
}
Also used : Repository(org.eclipse.jgit.lib.Repository) IEclipsePreferences(org.eclipse.core.runtime.preferences.IEclipsePreferences) RepositoryCache(org.eclipse.egit.core.RepositoryCache)

Aggregations

RepositoryCache (org.eclipse.egit.core.RepositoryCache)7 Repository (org.eclipse.jgit.lib.Repository)6 File (java.io.File)3 IOException (java.io.IOException)3 HashMap (java.util.HashMap)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 IFile (org.eclipse.core.resources.IFile)1 IPath (org.eclipse.core.runtime.IPath)1 Path (org.eclipse.core.runtime.Path)1 IEclipsePreferences (org.eclipse.core.runtime.preferences.IEclipsePreferences)1 RepositoryUtil (org.eclipse.egit.core.RepositoryUtil)1 CloneOperation (org.eclipse.egit.core.op.CloneOperation)1 Action (org.eclipse.jface.action.Action)1 IAction (org.eclipse.jface.action.IAction)1 URIish (org.eclipse.jgit.transport.URIish)1 IWorkbenchAction (org.eclipse.ui.actions.ActionFactory.IWorkbenchAction)1