diff options
author | Robin Stocker | 2013-08-12 19:26:43 +0000 |
---|---|---|
committer | Matthias Sohn | 2013-10-24 06:16:51 +0000 |
commit | b1b5a08aa2cd77cab6c367f1f4ea5f44e24c74f7 (patch) | |
tree | 09579f99ef63959ebb7d45e634dc69b2d1e8e849 /org.eclipse.egit.core/src/org/eclipse/egit/core | |
parent | d71ab684f680b63c27c3335cb078cf6175423ae8 (diff) | |
download | egit-b1b5a08aa2cd77cab6c367f1f4ea5f44e24c74f7.tar.gz egit-b1b5a08aa2cd77cab6c367f1f4ea5f44e24c74f7.tar.xz egit-b1b5a08aa2cd77cab6c367f1f4ea5f44e24c74f7.zip |
Replace use of internal GC class by command in GarbageCollectOperation
Change-Id: Id6772d603237b378c97c21862605ee97d90aeec7
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.core/src/org/eclipse/egit/core')
-rw-r--r-- | org.eclipse.egit.core/src/org/eclipse/egit/core/op/GarbageCollectOperation.java | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/GarbageCollectOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/GarbageCollectOperation.java index 54263f2e17..c8ef88250a 100644 --- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/GarbageCollectOperation.java +++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/GarbageCollectOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (C) 2012, Matthias Sohn <matthias.sohn@sap.com> + * Copyright (C) 2012, 2013 Matthias Sohn <matthias.sohn@sap.com> and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,9 +8,6 @@ *******************************************************************************/ package org.eclipse.egit.core.op; -import java.io.IOException; -import java.text.ParseException; - import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; @@ -19,9 +16,9 @@ import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.egit.core.Activator; import org.eclipse.egit.core.EclipseGitProgressTransformer; import org.eclipse.egit.core.internal.job.RuleUtil; +import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.lib.Repository; -import org.eclipse.jgit.internal.storage.file.FileRepository; -import org.eclipse.jgit.internal.storage.file.GC; /** * Operation to garbage collect a git repository @@ -41,15 +38,12 @@ public class GarbageCollectOperation implements IEGitOperation { * Execute garbage collection */ public void execute(IProgressMonitor monitor) throws CoreException { - GC gc = new GC((FileRepository) repository); - gc.setProgressMonitor(new EclipseGitProgressTransformer( - monitor)); + Git git = new Git(repository); + EclipseGitProgressTransformer pm = new EclipseGitProgressTransformer( + monitor); try { - gc.gc(); - } catch (IOException e) { - throw new CoreException(new Status(IStatus.ERROR, - Activator.getPluginId(), e.getMessage(), e)); - } catch (ParseException e) { + git.gc().setProgressMonitor(pm).call(); + } catch (GitAPIException e) { throw new CoreException(new Status(IStatus.ERROR, Activator.getPluginId(), e.getMessage(), e)); } |