This commit is contained in:
Mohamed Karray
2018-11-29 16:01:43 +01:00
62 changed files with 1253 additions and 983 deletions

View File

@@ -121,7 +121,7 @@ public class GitGcTask implements Runnable {
}
private void gc(Repository repository){
File file = repositoryHandler.getDirectory(repository);
File file = repositoryHandler.getDirectory(repository.getId());
Git git = null;
try {
git = open(file);

View File

@@ -119,7 +119,7 @@ public abstract class AbstractGitIncomingOutgoingCommand
Git git = Git.wrap(open());
GitUtil.fetch(git, handler.getDirectory(remoteRepository), remoteRepository);
GitUtil.fetch(git, handler.getDirectory(remoteRepository.getId()), remoteRepository);
ObjectId localId = getDefaultBranch(git.getRepository());
ObjectId remoteId = null;

View File

@@ -196,7 +196,7 @@ public abstract class AbstractGitPushOrPullCommand extends AbstractGitCommand
*/
protected String getRemoteUrl(sonia.scm.repository.Repository repository)
{
return getRemoteUrl(handler.getDirectory(repository));
return getRemoteUrl(handler.getDirectory(repository.getId()));
}
//~--- methods --------------------------------------------------------------

View File

@@ -196,12 +196,12 @@ public class GitPullCommand extends AbstractGitPushOrPullCommand
private PullResponse pullFromScmRepository(Repository sourceRepository)
throws IOException
{
File sourceDirectory = handler.getDirectory(sourceRepository);
File sourceDirectory = handler.getDirectory(sourceRepository.getId());
Preconditions.checkArgument(sourceDirectory.exists(),
"source repository directory does not exists");
File targetDirectory = handler.getDirectory(repository);
File targetDirectory = handler.getDirectory(repository.getId());
Preconditions.checkArgument(sourceDirectory.exists(),
"target repository directory does not exists");

View File

@@ -73,7 +73,7 @@ public class GitRepositoryServiceProvider extends RepositoryServiceProvider
public GitRepositoryServiceProvider(GitRepositoryHandler handler, Repository repository) {
this.handler = handler;
this.repository = repository;
this.context = new GitContext(handler.getDirectory(repository), repository);
this.context = new GitContext(handler.getDirectory(repository.getId()), repository);
}
//~--- methods --------------------------------------------------------------

View File

@@ -106,7 +106,7 @@ public class GitRepositoryResolver implements RepositoryResolver<HttpServletRequ
if (config.isValid())
{
File gitdir = handler.getDirectory(repo);
File gitdir = handler.getDirectory(repo.getId());
if (gitdir == null) {
throw new RepositoryNotFoundException(repositoryName);
}