File tree 2 files changed +7
-3
lines changed
main/java/org/springframework/data/release/git
test/java/org/springframework/data/release/git
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) {
436
436
437
437
Assert .notNull (trainIteration , "TrainIteration must not be null!" );
438
438
439
- if (trainIteration . getIteration (). isMilestone () && trainIteration .getIteration (). getIterationValue () == 1 ) {
439
+ if (isGaOrFirstMilestone ( trainIteration .getIteration ()) ) {
440
440
441
441
Train trainToUse = getPreviousTrain (trainIteration );
442
442
return trainToUse .getIteration (Iteration .GA );
@@ -546,6 +546,10 @@ private static Train getPreviousTrain(TrainIteration trainIteration) {
546
546
return trainToUse ;
547
547
}
548
548
549
+ private static boolean isGaOrFirstMilestone (Iteration iteration ) {
550
+ return iteration .isGAIteration () || (iteration .isMilestone () && iteration .getIterationValue () == 1 );
551
+ }
552
+
549
553
private Stream <Branch > getRemoteBranches (Project project ) {
550
554
551
555
return doWithGit (project , git -> {
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ void shouldDeterminePreviousIterationFromGA() throws Exception {
84
84
85
85
TrainIteration hopperRc1 = gitOperations .getPreviousIteration (ReleaseTrains .HOPPER .getIteration (Iteration .GA ));
86
86
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 );
89
89
90
90
TrainIteration hopperM1 = gitOperations .getPreviousIteration (ReleaseTrains .HOPPER .getIteration (Iteration .RC1 ));
91
91
You can’t perform that action at this time.
0 commit comments