@Override public Branch branchCreate(BranchCreateRequest request) throws GitException { ensureExistenceRepoRootInWorkingDirectory(); BranchCreateCommand branchCreateCommand = nativeGit.createBranchCreateCommand(); branchCreateCommand .setBranchName(request.getName()) .setStartPoint(request.getStartPoint()) .execute(); return DtoFactory.getInstance() .createDto(Branch.class) .withName(getBranchRef(request.getName())) .withActive(false) .withDisplayName(request.getName()) .withRemote(false); }
@Override public Branch branchCreate(BranchCreateRequest request) throws GitException { BranchCreateCommand branchCreateCommand = nativeGit.createBranchCreateCommand(); branchCreateCommand.setBranchName(request.getName()).setStartPoint(request.getStartPoint()); try { branchCreateCommand.execute(); } catch (ServerException exception) { if (noInitCommitWhenBranchCreateErrorPattern.matcher(exception.getMessage()).find()) { throw new GitException(exception.getMessage(), ErrorCodes.INIT_COMMIT_WAS_NOT_PERFORMED); } } return DtoFactory.getInstance() .createDto(Branch.class) .withName(getBranchRef(request.getName())) .withActive(false) .withDisplayName(request.getName()) .withRemote(false); }