Skip to content

Commit 4813944

Browse files
committed
Align naming: isForTrackedBranchOnly and onlyEvaluateTrackedBranches have been renamed to onlyTrackedBranches
1 parent ac22e93 commit 4813944

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

src/GitVersionCore.Tests/GitToolsTestingExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ public static Config ApplyDefaults(this Config config)
1414
return config;
1515
}
1616

17-
public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Config configuration = null, IRepository repository = null, string commitId = null, bool isForTrackedBranchOnly = true, string targetBranch = null)
17+
public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Config configuration = null, IRepository repository = null, string commitId = null, bool onlyTrackedBranches = true, string targetBranch = null)
1818
{
1919
if (configuration == null)
2020
{
2121
configuration = new Config();
2222
ConfigurationProvider.ApplyDefaultsTo(configuration);
2323
}
24-
var gitVersionContext = new GitVersionContext(repository ?? fixture.Repository, targetBranch, configuration, isForTrackedBranchOnly, commitId);
24+
var gitVersionContext = new GitVersionContext(repository ?? fixture.Repository, targetBranch, configuration, onlyTrackedBranches, commitId);
2525
var executeGitVersion = ExecuteGitVersion(gitVersionContext);
2626
var variables = VariableProvider.GetVariablesFor(executeGitVersion, gitVersionContext.Configuration, gitVersionContext.IsCurrentCommitTagged);
2727
try
@@ -36,19 +36,19 @@ public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Co
3636
}
3737
}
3838

39-
public static void AssertFullSemver(this RepositoryFixtureBase fixture, string fullSemver, IRepository repository = null, string commitId = null, bool isForTrackedBranchOnly = true, string targetBranch = null)
39+
public static void AssertFullSemver(this RepositoryFixtureBase fixture, string fullSemver, IRepository repository = null, string commitId = null, bool onlyTrackedBranches = true, string targetBranch = null)
4040
{
41-
fixture.AssertFullSemver(new Config(), fullSemver, repository, commitId, isForTrackedBranchOnly, targetBranch);
41+
fixture.AssertFullSemver(new Config(), fullSemver, repository, commitId, onlyTrackedBranches, targetBranch);
4242
}
4343

44-
public static void AssertFullSemver(this RepositoryFixtureBase fixture, Config configuration, string fullSemver, IRepository repository = null, string commitId = null, bool isForTrackedBranchOnly = true, string targetBranch = null)
44+
public static void AssertFullSemver(this RepositoryFixtureBase fixture, Config configuration, string fullSemver, IRepository repository = null, string commitId = null, bool onlyTrackedBranches = true, string targetBranch = null)
4545
{
4646
ConfigurationProvider.ApplyDefaultsTo(configuration);
4747
Console.WriteLine("---------");
4848

4949
try
5050
{
51-
var variables = fixture.GetVersion(configuration, repository, commitId, isForTrackedBranchOnly, targetBranch);
51+
var variables = fixture.GetVersion(configuration, repository, commitId, onlyTrackedBranches, targetBranch);
5252
variables.FullSemVer.ShouldBe(fullSemver);
5353
}
5454
catch (Exception)

src/GitVersionCore.Tests/IntegrationTests/DevelopScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public void WhenDevelopBranchedFromMasterDetachedHead_MinorIsIncreased()
157157
var commit = fixture.Repository.Head.Tip;
158158
fixture.Repository.MakeACommit();
159159
Commands.Checkout(fixture.Repository, commit);
160-
fixture.AssertFullSemver("1.1.0-alpha.1", isForTrackedBranchOnly: false);
160+
fixture.AssertFullSemver("1.1.0-alpha.1", onlyTrackedBranches: false);
161161
}
162162
}
163163

src/GitVersionCore.Tests/IntegrationTests/MasterScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public void GivenARepositoryWithCommitsButNoTagsWithDetachedHead_VersionShouldBe
9999
Commands.Checkout(fixture.Repository, commit);
100100

101101
// When
102-
fixture.AssertFullSemver("0.1.0+2", isForTrackedBranchOnly: false);
102+
fixture.AssertFullSemver("0.1.0+2", onlyTrackedBranches: false);
103103
}
104104
}
105105

src/GitVersionCore.Tests/IntegrationTests/RemoteRepositoryScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void GivenARemoteGitRepositoryWhenCheckingOutDetachedhead_UsingExistingIm
7070
fixture.LocalRepositoryFixture.Repository,
7171
fixture.LocalRepositoryFixture.Repository.Head.Tip);
7272

73-
Should.Throw<WarningException>(() => fixture.AssertFullSemver("0.1.0+4", fixture.LocalRepositoryFixture.Repository, isForTrackedBranchOnly: false),
73+
Should.Throw<WarningException>(() => fixture.AssertFullSemver("0.1.0+4", fixture.LocalRepositoryFixture.Repository, onlyTrackedBranches: false),
7474
string.Format("It looks like the branch being examined is a detached Head pointing to commit '{0}'. Without a proper branch name GitVersion cannot determine the build version.",
7575
fixture.LocalRepositoryFixture.Repository.Head.Tip.Id.ToString(7)));
7676
}

src/GitVersionCore/GitVersionContext.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ namespace GitVersion
99
/// </summary>
1010
public class GitVersionContext
1111
{
12-
public GitVersionContext(IRepository repository, string targetBranch, Config configuration, bool onlyEvaluateTrackedBranches = false, string commitId = null)
13-
: this(repository, GitVersionContext.GetTargetBranch(repository, targetBranch), configuration, onlyEvaluateTrackedBranches, commitId)
12+
public GitVersionContext(IRepository repository, string targetBranch, Config configuration, bool onlyTrackedBranches = false, string commitId = null)
13+
: this(repository, GitVersionContext.GetTargetBranch(repository, targetBranch), configuration, onlyTrackedBranches, commitId)
1414
{
1515
}
1616

17-
public GitVersionContext(IRepository repository, Branch currentBranch, Config configuration, bool onlyEvaluateTrackedBranches = false, string commitId = null)
17+
public GitVersionContext(IRepository repository, Branch currentBranch, Config configuration, bool onlyTrackedBranches = false, string commitId = null)
1818
{
1919
Repository = repository;
2020
RepositoryMetadataProvider = new GitRepoMetadataProvider(repository, configuration);
2121
FullConfiguration = configuration;
22-
OnlyEvaluateTrackedBranches = onlyEvaluateTrackedBranches;
22+
TrackedBranchesOnly = onlyTrackedBranches;
2323

2424
if (currentBranch == null)
2525
throw new InvalidOperationException("Need a branch to operate on");
@@ -47,7 +47,7 @@ public GitVersionContext(IRepository repository, Branch currentBranch, Config co
4747

4848
if (currentBranch.IsDetachedHead())
4949
{
50-
CurrentBranch = RepositoryMetadataProvider.GetBranchesContainingCommit(CurrentCommit, repository.Branches.ToList(), OnlyEvaluateTrackedBranches).OnlyOrDefault() ?? currentBranch;
50+
CurrentBranch = RepositoryMetadataProvider.GetBranchesContainingCommit(CurrentCommit, repository.Branches.ToList(), TrackedBranchesOnly).OnlyOrDefault() ?? currentBranch;
5151
}
5252
else
5353
{
@@ -73,7 +73,7 @@ public GitVersionContext(IRepository repository, Branch currentBranch, Config co
7373
/// </summary>
7474
public Config FullConfiguration { get; private set; }
7575
public SemanticVersion CurrentCommitTaggedVersion { get; private set; }
76-
public bool OnlyEvaluateTrackedBranches { get; private set; }
76+
public bool TrackedBranchesOnly { get; private set; }
7777
public EffectiveConfiguration Configuration { get; private set; }
7878
public IRepository Repository { get; private set; }
7979
public Branch CurrentBranch { get; private set; }

0 commit comments

Comments
 (0)