Skip to content

Commit

Permalink
remove dependency on LocalVcService
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonEntholzer committed Sep 16, 2024
1 parent 5b83bec commit 391b8b6
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.tum.cit.aet.artemis.programming.web.repository;

import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_CORE;
import static de.tum.cit.aet.artemis.programming.service.localvc.LocalVCService.getDefaultBranchOfRepository;

import java.security.Principal;
import java.util.List;
Expand Down Expand Up @@ -47,7 +48,7 @@
import de.tum.cit.aet.artemis.programming.service.GitService;
import de.tum.cit.aet.artemis.programming.service.RepositoryAccessService;
import de.tum.cit.aet.artemis.programming.service.RepositoryService;
import de.tum.cit.aet.artemis.programming.service.localvc.LocalVCService;
import de.tum.cit.aet.artemis.programming.service.localvc.LocalVCRepositoryUri;
import de.tum.cit.aet.artemis.programming.service.localvc.LocalVCServletService;
import de.tum.cit.aet.artemis.programming.service.vcs.VersionControlService;

Expand All @@ -61,16 +62,12 @@ public class AuxiliaryRepositoryResource extends RepositoryResource {

private final AuxiliaryRepositoryRepository auxiliaryRepositoryRepository;

private final LocalVCService localVcService;

public AuxiliaryRepositoryResource(ProfileService profileService, UserRepository userRepository, AuthorizationCheckService authCheckService, GitService gitService,
RepositoryService repositoryService, Optional<VersionControlService> versionControlService, ProgrammingExerciseRepository programmingExerciseRepository,
RepositoryAccessService repositoryAccessService, Optional<LocalVCServletService> localVCServletService, AuxiliaryRepositoryRepository auxiliaryRepositoryRepository,
LocalVCService localVcService) {
RepositoryAccessService repositoryAccessService, Optional<LocalVCServletService> localVCServletService, AuxiliaryRepositoryRepository auxiliaryRepositoryRepository) {
super(profileService, userRepository, authCheckService, gitService, repositoryService, versionControlService, programmingExerciseRepository, repositoryAccessService,
localVCServletService);
this.auxiliaryRepositoryRepository = auxiliaryRepositoryRepository;
this.localVcService = localVcService;
}

@Override
Expand Down Expand Up @@ -103,7 +100,8 @@ boolean canAccessRepository(Long auxiliaryRepositoryId) {
@Override
String getOrRetrieveBranchOfDomainObject(Long auxiliaryRepositoryId) {
AuxiliaryRepository auxiliaryRep = auxiliaryRepositoryRepository.findByIdElseThrow(auxiliaryRepositoryId);
return localVcService.getDefaultBranchOfRepository(auxiliaryRep.getVcsRepositoryUri());
LocalVCRepositoryUri localVCRepositoryUri = new LocalVCRepositoryUri(auxiliaryRep.getRepositoryUri());
return getDefaultBranchOfRepository(localVCRepositoryUri);
}

@Override
Expand Down

0 comments on commit 391b8b6

Please sign in to comment.