mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 03:25:56 +01:00
Cleanup
This commit is contained in:
@@ -35,7 +35,6 @@ import javax.servlet.ServletContextListener;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@Extension
|
||||
public abstract class SimpleWorkingCopyFactory<R, W, C> implements WorkingCopyFactory<R, W, C>, ServletContextListener {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SimpleWorkingCopyFactory.class);
|
||||
@@ -76,7 +75,7 @@ public abstract class SimpleWorkingCopyFactory<R, W, C> implements WorkingCopyFa
|
||||
LOG.warn("could not close central repository for {}", workingCopyContext.getScmRepository(), e);
|
||||
}
|
||||
try {
|
||||
closeWorkingCopy(parentAndClone.getClone());
|
||||
closeWorkingCopyInternal(parentAndClone.getClone());
|
||||
} catch (Exception e) {
|
||||
LOG.warn("could not close clone for {} in directory {}", workingCopyContext.getScmRepository(), parentAndClone.getDirectory(), e);
|
||||
}
|
||||
@@ -120,22 +119,6 @@ public abstract class SimpleWorkingCopyFactory<R, W, C> implements WorkingCopyFa
|
||||
|
||||
protected abstract ParentAndClone<R, W> reclaimRepository(C context, File target, String initialBranch) throws IOException, ReclaimFailedException;
|
||||
|
||||
private void closeCentral(R repository) {
|
||||
try {
|
||||
closeRepository(repository);
|
||||
} catch (Exception e) {
|
||||
LOG.warn("could not close temporary repository clone", e);
|
||||
}
|
||||
}
|
||||
|
||||
private void closeWorkingCopy(W repository) {
|
||||
try {
|
||||
closeWorkingCopyInternal(repository);
|
||||
} catch (Exception e) {
|
||||
LOG.warn("could not close temporary repository clone", e);
|
||||
}
|
||||
}
|
||||
|
||||
protected static class ParentAndClone<R, W> {
|
||||
private final R parent;
|
||||
private final W clone;
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
package sonia.scm.repository.util;
|
||||
|
||||
import sonia.scm.plugin.ExtensionPoint;
|
||||
|
||||
public interface WorkingCopyFactory<R, W, C> {
|
||||
WorkingCopy<R, W> createWorkingCopy(C repositoryContext, String initialBranch);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class SimpleSvnWorkingCopyFactoryTest extends AbstractSvnCommandTestBase
|
||||
}
|
||||
|
||||
@Test
|
||||
public void cloneFromPoolshouldNotBeReused() {
|
||||
public void cloneFromPoolShouldNotBeReused() {
|
||||
SimpleSvnWorkingCopyFactory factory = new SimpleSvnWorkingCopyFactory(new NoneCachingWorkingCopyPool(workdirProvider));
|
||||
|
||||
File firstDirectory;
|
||||
|
||||
Reference in New Issue
Block a user