mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-10-31 18:46:07 +01:00 
			
		
		
		
	Keep ParentAndClone inside working copy factories
This commit is contained in:
		| @@ -33,7 +33,7 @@ import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | ||||
| import sonia.scm.repository.InternalRepositoryException; | ||||
| import sonia.scm.repository.work.SimpleWorkingCopyFactory; | ||||
| import sonia.scm.repository.work.WorkingCopyPool; | ||||
| import sonia.scm.repository.work.SimpleWorkingCopyFactory.ParentAndClone; | ||||
|  | ||||
| import java.io.File; | ||||
| import java.io.IOException; | ||||
| @@ -54,7 +54,7 @@ class GitWorkingCopyInitializer implements SimpleWorkingCopyFactory.WorkingCopyI | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public WorkingCopyPool.ParentAndClone<Repository, Repository> initialize(File target, String initialBranch) { | ||||
|   public ParentAndClone<Repository, Repository> initialize(File target, String initialBranch) { | ||||
|     LOG.trace("clone repository {}", context.getRepository().getId()); | ||||
|     long start = System.nanoTime(); | ||||
|     try { | ||||
| @@ -71,7 +71,7 @@ class GitWorkingCopyInitializer implements SimpleWorkingCopyFactory.WorkingCopyI | ||||
|         throw notFound(entity("Branch", initialBranch).in(context.getRepository())); | ||||
|       } | ||||
|  | ||||
|       return new WorkingCopyPool.ParentAndClone<>(null, clone, target); | ||||
|       return new ParentAndClone<>(null, clone, target); | ||||
|     } catch (GitAPIException | IOException e) { | ||||
|       throw new InternalRepositoryException(context.getRepository(), "could not clone working copy of repository", e); | ||||
|     } finally { | ||||
|   | ||||
| @@ -32,7 +32,7 @@ import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | ||||
| import sonia.scm.repository.GitUtil; | ||||
| import sonia.scm.repository.work.SimpleWorkingCopyFactory; | ||||
| import sonia.scm.repository.work.WorkingCopyPool; | ||||
| import sonia.scm.repository.work.SimpleWorkingCopyFactory.ParentAndClone; | ||||
|  | ||||
| import java.io.File; | ||||
| import java.io.IOException; | ||||
| @@ -48,7 +48,7 @@ class GitWorkingCopyReclaimer implements SimpleWorkingCopyFactory.WorkingCopyRec | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public WorkingCopyPool.ParentAndClone<Repository, Repository> reclaim(File target, String initialBranch) throws SimpleWorkingCopyFactory.ReclaimFailedException { | ||||
|   public ParentAndClone<Repository, Repository> reclaim(File target, String initialBranch) throws SimpleWorkingCopyFactory.ReclaimFailedException { | ||||
|     LOG.trace("reclaim repository {}", context.getRepository().getId()); | ||||
|     long start = System.nanoTime(); | ||||
|     Repository repo = openTarget(target); | ||||
| @@ -59,7 +59,7 @@ class GitWorkingCopyReclaimer implements SimpleWorkingCopyFactory.WorkingCopyRec | ||||
|       git.checkout().setForced(true).setName("origin/" + initialBranch).call(); | ||||
|       git.branchDelete().setBranchNames(initialBranch).setForce(true).call(); | ||||
|       git.checkout().setName(initialBranch).setCreateBranch(true).call(); | ||||
|       return new WorkingCopyPool.ParentAndClone<>(null, repo, target); | ||||
|       return new ParentAndClone<>(null, repo, target); | ||||
|     } catch (GitAPIException | IOException e) { | ||||
|       throw new SimpleWorkingCopyFactory.ReclaimFailedException(e); | ||||
|     } finally { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user