File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
main/java/org/springframework/data/release/git
test/java/org/springframework/data/release/git Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -436,7 +436,7 @@ public TrainIteration getPreviousIteration(TrainIteration trainIteration) {
436436
437437 Assert .notNull (trainIteration , "TrainIteration must not be null!" );
438438
439- if (trainIteration . getIteration (). isMilestone () && trainIteration .getIteration (). getIterationValue () == 1 ) {
439+ if (isGaOrFirstMilestone ( trainIteration .getIteration ()) ) {
440440
441441 Train trainToUse = getPreviousTrain (trainIteration );
442442 return trainToUse .getIteration (Iteration .GA );
@@ -546,6 +546,10 @@ private static Train getPreviousTrain(TrainIteration trainIteration) {
546546 return trainToUse ;
547547 }
548548
549+ private static boolean isGaOrFirstMilestone (Iteration iteration ) {
550+ return iteration .isGAIteration () || (iteration .isMilestone () && iteration .getIterationValue () == 1 );
551+ }
552+
549553 private Stream <Branch > getRemoteBranches (Project project ) {
550554
551555 return doWithGit (project , git -> {
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ void shouldDeterminePreviousIterationFromGA() throws Exception {
8484
8585 TrainIteration hopperRc1 = gitOperations .getPreviousIteration (ReleaseTrains .HOPPER .getIteration (Iteration .GA ));
8686
87- assertThat (hopperRc1 .getTrain ()).isEqualTo (ReleaseTrains .HOPPER );
88- assertThat (hopperRc1 .getIteration ()).isEqualTo (Iteration .RC1 );
87+ assertThat (hopperRc1 .getTrain ()).isEqualTo (ReleaseTrains .GOSLING );
88+ assertThat (hopperRc1 .getIteration ()).isEqualTo (Iteration .GA );
8989
9090 TrainIteration hopperM1 = gitOperations .getPreviousIteration (ReleaseTrains .HOPPER .getIteration (Iteration .RC1 ));
9191
You can’t perform that action at this time.
0 commit comments