Implement peer review comments

This commit is contained in:
René Pfeuffer
2019-03-29 15:39:44 +01:00
parent 89de300137
commit 2e93a9efec
14 changed files with 143 additions and 74 deletions

View File

@@ -79,11 +79,8 @@ public class GitBranchCommand extends AbstractGitCommand implements BranchComman
private void handlePushError(RemoteRefUpdate remoteRefUpdate, BranchRequest request, Repository repository) {
if (remoteRefUpdate.getStatus() != RemoteRefUpdate.Status.OK) {
// TODO handle failed remote update
throw new RuntimeException(
String.format("Could not pull new branch '%s' into central repository '%s': %s",
request.getNewBranch(),
repository.getNamespaceAndName(),
remoteRefUpdate.getMessage()));
throw new IntegrateChangesFromWorkdirException(repository,
String.format("Could not push new branch '%s' into central repository", request.getNewBranch()));
}
}
}

View File

@@ -47,8 +47,6 @@ public class GitMergeCommand extends AbstractGitCommand implements MergeCommand
@Override
public MergeCommandResult merge(MergeCommandRequest request) {
RepositoryPermissions.push(context.getRepository().getId()).check();
try (WorkingCopy<Repository> workingCopy = workdirFactory.createWorkingCopy(context)) {
Repository repository = workingCopy.getWorkingRepository();
logger.debug("cloned repository to folder {}", repository.getWorkTree());