@@ -154,6 +154,97 @@ public void MergeIntoMainline()
154
154
fixture . AssertFullSemver ( "1.0.0" , config ) ;
155
155
}
156
156
157
+ [ Test ]
158
+ public void MergeFeatureIntoMainline ( )
159
+ {
160
+ var config = new Config
161
+ {
162
+ VersioningMode = VersioningMode . Mainline
163
+ } ;
164
+
165
+ using var fixture = new EmptyRepositoryFixture ( ) ;
166
+ fixture . MakeACommit ( ) ;
167
+ fixture . ApplyTag ( "1.0.0" ) ;
168
+ fixture . AssertFullSemver ( "1.0.0" , config ) ;
169
+
170
+ fixture . BranchTo ( "feature/foo" ) ;
171
+ fixture . MakeACommit ( ) ;
172
+ fixture . AssertFullSemver ( "1.0.1-foo.1" , config ) ;
173
+ fixture . ApplyTag ( "1.0.1-foo.1" ) ;
174
+
175
+ fixture . Checkout ( "master" ) ;
176
+ fixture . MergeNoFF ( "feature/foo" ) ;
177
+ fixture . AssertFullSemver ( "1.0.1" , config ) ;
178
+ }
179
+
180
+ [ Test ]
181
+ public void MergeFeatureIntoMainlineWithMinorIncrement ( )
182
+ {
183
+ var config = new Config
184
+ {
185
+ VersioningMode = VersioningMode . Mainline ,
186
+ Branches = new Dictionary < string , BranchConfig > ( )
187
+ {
188
+ { "feature" , new BranchConfig { Increment = IncrementStrategy . Minor } }
189
+ } ,
190
+ Ignore = new IgnoreConfig ( ) { ShAs = new List < string > ( ) } ,
191
+ MergeMessageFormats = new Dictionary < string , string > ( )
192
+ } ;
193
+
194
+ using var fixture = new EmptyRepositoryFixture ( ) ;
195
+ fixture . MakeACommit ( ) ;
196
+ fixture . ApplyTag ( "1.0.0" ) ;
197
+ fixture . AssertFullSemver ( "1.0.0" , config ) ;
198
+
199
+ fixture . BranchTo ( "feature/foo" ) ;
200
+ fixture . MakeACommit ( ) ;
201
+ fixture . AssertFullSemver ( "1.1.0-foo.1" , config ) ;
202
+ fixture . ApplyTag ( "1.1.0-foo.1" ) ;
203
+
204
+ fixture . Checkout ( "master" ) ;
205
+ fixture . MergeNoFF ( "feature/foo" ) ;
206
+ fixture . AssertFullSemver ( "1.1.0" , config ) ;
207
+ }
208
+
209
+ [ Test ]
210
+ public void MergeFeatureIntoMainlineWithMinorIncrementAndThenMergeHotfix ( )
211
+ {
212
+ var config = new Config
213
+ {
214
+ VersioningMode = VersioningMode . Mainline ,
215
+ Branches = new Dictionary < string , BranchConfig > ( )
216
+ {
217
+ { "feature" , new BranchConfig { Increment = IncrementStrategy . Minor } }
218
+ } ,
219
+ Ignore = new IgnoreConfig ( ) { ShAs = new List < string > ( ) } ,
220
+ MergeMessageFormats = new Dictionary < string , string > ( )
221
+ } ;
222
+
223
+ using var fixture = new EmptyRepositoryFixture ( ) ;
224
+ fixture . MakeACommit ( ) ;
225
+ fixture . ApplyTag ( "1.0.0" ) ;
226
+ fixture . AssertFullSemver ( "1.0.0" , config ) ;
227
+
228
+ fixture . BranchTo ( "feature/foo" ) ;
229
+ fixture . MakeACommit ( ) ;
230
+ fixture . AssertFullSemver ( "1.1.0-foo.1" , config ) ;
231
+ fixture . ApplyTag ( "1.1.0-foo.1" ) ;
232
+
233
+ fixture . Checkout ( "master" ) ;
234
+ fixture . MergeNoFF ( "feature/foo" ) ;
235
+ fixture . AssertFullSemver ( "1.1.0" , config ) ;
236
+ fixture . ApplyTag ( "1.1.0" ) ;
237
+
238
+ fixture . BranchTo ( "hotfix/bar" ) ;
239
+ fixture . MakeACommit ( ) ;
240
+ fixture . AssertFullSemver ( "1.1.1-beta.1" , config ) ;
241
+ fixture . ApplyTag ( "1.1.1-beta.1" ) ;
242
+
243
+ fixture . Checkout ( "master" ) ;
244
+ fixture . MergeNoFF ( "hotfix/bar" ) ;
245
+ fixture . AssertFullSemver ( "1.1.1" , config ) ;
246
+ }
247
+
157
248
[ Test ]
158
249
public void PreReleaseTagCanUseBranchNameVariable ( )
159
250
{
0 commit comments