Enhance branch object with default flag

This commit is contained in:
René Pfeuffer
2019-03-25 11:28:29 +01:00
parent 5aab95b651
commit 4ec7006108
9 changed files with 26 additions and 10 deletions

View File

@@ -12,6 +12,7 @@ public class BranchDto extends HalRepresentation {
private String name;
private String revision;
private boolean defaultBranch;
BranchDto(Links links, Embedded embedded) {
super(links, embedded);

View File

@@ -60,7 +60,7 @@ public abstract class DefaultChangesetToChangesetDtoMapper extends HalAppenderMa
}
if (repositoryService.isSupported(Command.BRANCHES)) {
embeddedBuilder.with("branches", branchCollectionToDtoMapper.getBranchDtoList(namespace, name,
getListOfObjects(source.getBranches(), branchName -> new Branch(branchName, source.getId()))));
getListOfObjects(source.getBranches(), branchName -> Branch.normalBranch(branchName, source.getId()))));
}
}
embeddedBuilder.with("parents", getListOfObjects(source.getParents(), parent -> changesetToParentDtoMapper.map(new Changeset(parent, 0L, null), repository)));