Source:
<code>public FactoryDto createFactory(@NotNull final Map<String, String> factoryParameters) throws BadRequestException, ServerException { final GithubUrl githubUrl = githubUrlParser.parse(factoryParameters.get(URL_PARAMETER_NAME)); FactoryDto factory = urlFactoryBuilder .createFactoryFromDevfile( githubUrl, fileName -> urlFetcher.fetch(githubUrl.rawFileLocation(fileName)), extractOverrideParams(factoryParameters)) .orElseGet( () -> urlFactoryBuilder .createFactoryFromJson(githubUrl) .orElseGet( () -> newDto(FactoryDto.class) .withV(CURRENT_VERSION) .withSource("repo"))); if (factory.getWorkspace() != null) { return projectConfigDtoMerger.merge( factory, () -> { return newDto(ProjectConfigDto.class) .withSource(githubSourceStorageBuilder.buildWorkspaceConfigSource(githubUrl)) .withName(githubUrl.getRepository()) .withPath("/".concat(githubUrl.getRepository())); }); } else if (factory.getDevfile() == null) { factory.setDevfile(urlFactoryBuilder.buildDefaultDevfile(githubUrl.getRepository())); } List<ProjectDto> projects = factory.getDevfile().getProjects(); if (projects.isEmpty()) { factory .getDevfile() .setProjects( Collections.singletonList( newDto(ProjectDto.class) .withSource(githubSourceStorageBuilder.buildDevfileSource(githubUrl)) .withName(githubUrl.getRepository()))); } else { projects.forEach( project -> { <START> if (project.getSource().getLocation().equals(githubUrl.repositoryLocation() + ".git")) { <END> project.getSource().setBranch(githubUrl.getBranch()); } }); } return factory; }</code><technical_language>git is mandatory github. work if I defined project .git</technical_language>

Target:
public FactoryDto createFactory(@NotNull final Map<String, String> factoryParameters) throws BadRequestException, ServerException { final GithubUrl githubUrl = githubUrlParser.parse(factoryParameters.get(URL_PARAMETER_NAME)); FactoryDto factory = urlFactoryBuilder .createFactoryFromDevfile( githubUrl, fileName -> urlFetcher.fetch(githubUrl.rawFileLocation(fileName)), extractOverrideParams(factoryParameters)) .orElseGet( () -> urlFactoryBuilder .createFactoryFromJson(githubUrl) .orElseGet( () -> newDto(FactoryDto.class) .withV(CURRENT_VERSION) .withSource("repo"))); if (factory.getWorkspace() != null) { return projectConfigDtoMerger.merge( factory, () -> { return newDto(ProjectConfigDto.class) .withSource(githubSourceStorageBuilder.buildWorkspaceConfigSource(githubUrl)) .withName(githubUrl.getRepository()) .withPath("/".concat(githubUrl.getRepository())); }); } else if (factory.getDevfile() == null) { factory.setDevfile(urlFactoryBuilder.buildDefaultDevfile(githubUrl.getRepository())); } List<ProjectDto> projects = factory.getDevfile().getProjects(); if (projects.isEmpty()) { factory .getDevfile() .setProjects( Collections.singletonList( newDto(ProjectDto.class) .withSource(githubSourceStorageBuilder.buildDevfileSource(githubUrl)) .withName(githubUrl.getRepository()))); } else { projects.forEach( project -> { final String location = project.getSource().getLocation(); if (location.equals(githubUrl.repositoryLocation()) || location.equals(githubUrl.repositoryLocation() + ".git")) { project.getSource().setBranch(githubUrl.getBranch()); } }); } return factory; }