1
- using GitTools . Testing ;
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Diagnostics ;
4
+ using GitTools ;
5
+ using GitTools . Testing ;
2
6
using GitVersion ;
3
7
using GitVersionCore . Tests ;
4
8
using LibGit2Sharp ;
@@ -360,4 +364,50 @@ public void MergeOnReleaseBranchShouldNotResetCount()
360
364
fixture . AssertFullSemver ( config , "2.0.0-beta.2" ) ;
361
365
}
362
366
}
367
+
368
+ [ Test ]
369
+ public void ReleaseBranchShouldUseBranchNameVersionDespiteBumpInPreviousCommit ( )
370
+ {
371
+ using ( var fixture = new EmptyRepositoryFixture ( ) )
372
+ {
373
+ fixture . Repository . MakeATaggedCommit ( "1.0" ) ;
374
+ fixture . Repository . MakeACommit ( "+semver:major" ) ;
375
+ fixture . Repository . MakeACommit ( ) ;
376
+
377
+ Commands . Checkout ( fixture . Repository , fixture . Repository . CreateBranch ( "release/2.0" ) ) ;
378
+
379
+ fixture . AssertFullSemver ( "2.0.0-beta.1+2" ) ;
380
+ }
381
+ }
382
+
383
+ [ Test ]
384
+ public void ReleaseBranchWithACommitShouldUseBranchNameVersionDespiteBumpInPreviousCommit ( )
385
+ {
386
+ using ( var fixture = new EmptyRepositoryFixture ( ) )
387
+ {
388
+ fixture . Repository . MakeATaggedCommit ( "1.0" ) ;
389
+ fixture . Repository . MakeACommit ( "+semver:major" ) ;
390
+ fixture . Repository . MakeACommit ( ) ;
391
+
392
+ Commands . Checkout ( fixture . Repository , fixture . Repository . CreateBranch ( "release/2.0" ) ) ;
393
+
394
+ fixture . Repository . MakeACommit ( ) ;
395
+
396
+ fixture . AssertFullSemver ( "2.0.0-beta.1+3" ) ;
397
+ }
398
+ }
399
+
400
+ [ Test ]
401
+ public void ReleaseBranchedAtCommitWithSemverMessageShouldUseBranchNameVersion ( )
402
+ {
403
+ using ( var fixture = new EmptyRepositoryFixture ( ) )
404
+ {
405
+ fixture . Repository . MakeATaggedCommit ( "1.0" ) ;
406
+ fixture . Repository . MakeACommit ( "+semver:major" ) ;
407
+
408
+ Commands . Checkout ( fixture . Repository , fixture . Repository . CreateBranch ( "release/2.0" ) ) ;
409
+
410
+ fixture . AssertFullSemver ( "2.0.0-beta.1+1" ) ;
411
+ }
412
+ }
363
413
}
0 commit comments