@@ -15,14 +15,14 @@ public static Config ApplyDefaults(this Config config)
15
15
return config ;
16
16
}
17
17
18
- public static VersionVariables GetVersion ( this RepositoryFixtureBase fixture , Config configuration = null , IRepository repository = null , string commitId = null , bool isForTrackedBranchOnly = true )
18
+ public static VersionVariables GetVersion ( this RepositoryFixtureBase fixture , Config configuration = null , IRepository repository = null , string commitId = null , bool isForTrackedBranchOnly = true , string targetBranch = null )
19
19
{
20
20
if ( configuration == null )
21
21
{
22
22
configuration = new Config ( ) ;
23
23
ConfigurationProvider . ApplyDefaultsTo ( configuration ) ;
24
24
}
25
- var gitVersionContext = new GitVersionContext ( repository ?? fixture . Repository , configuration , isForTrackedBranchOnly , commitId ) ;
25
+ var gitVersionContext = new GitVersionContext ( repository ?? fixture . Repository , targetBranch , configuration , isForTrackedBranchOnly , commitId ) ;
26
26
var executeGitVersion = ExecuteGitVersion ( gitVersionContext ) ;
27
27
var variables = VariableProvider . GetVariablesFor ( executeGitVersion , gitVersionContext . Configuration , gitVersionContext . IsCurrentCommitTagged ) ;
28
28
try
@@ -37,19 +37,19 @@ public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Co
37
37
}
38
38
}
39
39
40
- public static void AssertFullSemver ( this RepositoryFixtureBase fixture , string fullSemver , IRepository repository = null , string commitId = null , bool isForTrackedBranchOnly = true )
40
+ public static void AssertFullSemver ( this RepositoryFixtureBase fixture , string fullSemver , IRepository repository = null , string commitId = null , bool isForTrackedBranchOnly = true , string targetBranch = null )
41
41
{
42
- fixture . AssertFullSemver ( new Config ( ) , fullSemver , repository , commitId , isForTrackedBranchOnly ) ;
42
+ fixture . AssertFullSemver ( new Config ( ) , fullSemver , repository , commitId , isForTrackedBranchOnly , targetBranch ) ;
43
43
}
44
44
45
- public static void AssertFullSemver ( this RepositoryFixtureBase fixture , Config configuration , string fullSemver , IRepository repository = null , string commitId = null , bool isForTrackedBranchOnly = true )
45
+ public static void AssertFullSemver ( this RepositoryFixtureBase fixture , Config configuration , string fullSemver , IRepository repository = null , string commitId = null , bool isForTrackedBranchOnly = true , string targetBranch = null )
46
46
{
47
47
ConfigurationProvider . ApplyDefaultsTo ( configuration ) ;
48
48
Console . WriteLine ( "---------" ) ;
49
49
50
50
try
51
51
{
52
- var variables = fixture . GetVersion ( configuration , repository , commitId , isForTrackedBranchOnly ) ;
52
+ var variables = fixture . GetVersion ( configuration , repository , commitId , isForTrackedBranchOnly , targetBranch ) ;
53
53
variables . FullSemVer . ShouldBe ( fullSemver ) ;
54
54
}
55
55
catch ( Exception )
0 commit comments