#16 -- Checkout specific branch

This commit is contained in:
Anton Romanov 2021-03-29 12:04:52 +04:00
parent 99415a1a22
commit 14a7983f49

View File

@ -32,6 +32,7 @@ import static org.apache.logging.log4j.util.Strings.isBlank;
@Service @Service
public class GitRepositoryService { public class GitRepositoryService {
private static final String BRANCH_PREFIX = "refs/remotes/origin/";
@Value("${extractor.custom-projects-dir}") @Value("${extractor.custom-projects-dir}")
private String customProjectsDir; private String customProjectsDir;
@ -207,7 +208,7 @@ public class GitRepositoryService {
return git.branchList().setListMode(ListBranchCommand.ListMode.REMOTE) return git.branchList().setListMode(ListBranchCommand.ListMode.REMOTE)
.call() .call()
.stream() .stream()
.map(r -> new Branch(r.getName())) .map(r -> new Branch(r.getName().replace(BRANCH_PREFIX, "")))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
} }