Fixed wrong branch checking out

This commit is contained in:
Marcin Grzejszczak
2018-06-28 15:51:10 +02:00
parent cf1c5c47ea
commit e4871c68ae
6 changed files with 8 additions and 5 deletions

View File

@@ -142,7 +142,7 @@ public class ProjectGitHandler implements ReleaserPropertiesAware {
return splitVersion[0] + "." + splitVersion[1] + ".x";
} else if (splitVersion.length == 1) {
// [Camden] -> [Camden.x]
return splitVersion[0] + ".x";
return splitVersion[0];
}
throw new IllegalStateException("Wrong version [" + version + "]. Can't extract semver pieces of it");

View File

@@ -125,11 +125,11 @@ public class ProjectGitHandlerTests {
public void should_check_out_a_branch_if_it_exists_when_cloning_from_org_and_its_a_release_train_version() {
this.properties.getFixedVersions().put("spring-cloud-release", "Finchley.SR6");
given(this.gitRepo.hasBranch(anyString())).willReturn(false);
given(this.gitRepo.hasBranch("Finchley.x")).willReturn(true);
given(this.gitRepo.hasBranch("Finchley")).willReturn(true);
this.updater.cloneProjectFromOrg("spring-cloud-release");
then(this.gitRepo).should().checkout("Finchley.x");
then(this.gitRepo).should().checkout("Finchley");
}
private ProjectVersion projectVersion(String version) {