Skip to content

Commit 54baccd

Browse files
committed
Align naming: renamed isForTrackedBranchOnly and onlyEvaluateTrackedBranches to onlyTrackedBranches
1 parent e03b27b commit 54baccd

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
@@ -19,7 +19,7 @@ public static class GitToolsTestingExtensions
1919

2020
static GitToolsTestingExtensions() => sp = ConfigureService();
2121

22-
public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Config configuration = null, IRepository repository = null, string commitId = null, bool isForTrackedBranchOnly = true, string targetBranch = null)
22+
public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Config configuration = null, IRepository repository = null, string commitId = null, bool onlyTrackedBranches = true, string targetBranch = null)
2323
{
2424
if (configuration == null)
2525
{
@@ -31,7 +31,7 @@ public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Co
3131
var variableProvider = sp.GetService<IVariableProvider>();
3232
var versionFinder = sp.GetService<IGitVersionFinder>();
3333

34-
var gitVersionContext = new GitVersionContext(repository ?? fixture.Repository, log, targetBranch, configuration, isForTrackedBranchOnly, commitId);
34+
var gitVersionContext = new GitVersionContext(repository ?? fixture.Repository, log, targetBranch, configuration, onlyTrackedBranches, commitId);
3535
var executeGitVersion = versionFinder.FindVersion(gitVersionContext);
3636
var variables = variableProvider.GetVariablesFor(executeGitVersion, gitVersionContext.Configuration, gitVersionContext.IsCurrentCommitTagged);
3737

@@ -47,19 +47,19 @@ public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Co
4747
}
4848
}
4949

50-
public static void AssertFullSemver(this RepositoryFixtureBase fixture, string fullSemver, IRepository repository = null, string commitId = null, bool isForTrackedBranchOnly = true, string targetBranch = null)
50+
public static void AssertFullSemver(this RepositoryFixtureBase fixture, string fullSemver, IRepository repository = null, string commitId = null, bool onlyTrackedBranches = true, string targetBranch = null)
5151
{
52-
fixture.AssertFullSemver(new Config(), fullSemver, repository, commitId, isForTrackedBranchOnly, targetBranch);
52+
fixture.AssertFullSemver(new Config(), fullSemver, repository, commitId, onlyTrackedBranches, targetBranch);
5353
}
5454

55-
public static void AssertFullSemver(this RepositoryFixtureBase fixture, Config configuration, string fullSemver, IRepository repository = null, string commitId = null, bool isForTrackedBranchOnly = true, string targetBranch = null)
55+
public static void AssertFullSemver(this RepositoryFixtureBase fixture, Config configuration, string fullSemver, IRepository repository = null, string commitId = null, bool onlyTrackedBranches = true, string targetBranch = null)
5656
{
5757
configuration.Reset();
5858
Console.WriteLine("---------");
5959

6060
try
6161
{
62-
var variables = fixture.GetVersion(configuration, repository, commitId, isForTrackedBranchOnly, targetBranch);
62+
var variables = fixture.GetVersion(configuration, repository, commitId, onlyTrackedBranches, targetBranch);
6363
variables.FullSemVer.ShouldBe(fullSemver);
6464
}
6565
catch (Exception)

src/GitVersionCore.Tests/IntegrationTests/DevelopScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public void WhenDevelopBranchedFromMasterDetachedHeadMinorIsIncreased()
143143
var commit = fixture.Repository.Head.Tip;
144144
fixture.Repository.MakeACommit();
145145
Commands.Checkout(fixture.Repository, commit);
146-
fixture.AssertFullSemver("1.1.0-alpha.1", isForTrackedBranchOnly: false);
146+
fixture.AssertFullSemver("1.1.0-alpha.1", onlyTrackedBranches: false);
147147
}
148148

149149
[Test]

src/GitVersionCore.Tests/IntegrationTests/MasterScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public void GivenARepositoryWithCommitsButNoTagsWithDetachedHeadVersionShouldBe0
9393
Commands.Checkout(fixture.Repository, commit);
9494

9595
// When
96-
fixture.AssertFullSemver("0.1.0+2", isForTrackedBranchOnly: false);
96+
fixture.AssertFullSemver("0.1.0+2", onlyTrackedBranches: false);
9797
}
9898

9999
[Test]

src/GitVersionCore.Tests/IntegrationTests/RemoteRepositoryScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void GivenARemoteGitRepositoryWhenCheckingOutDetachedheadUsingExistingImp
6868
fixture.LocalRepositoryFixture.Repository,
6969
fixture.LocalRepositoryFixture.Repository.Head.Tip);
7070

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

src/GitVersionCore/GitVersionContext.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ public class GitVersionContext
1414
{
1515
private readonly ILog log;
1616

17-
public GitVersionContext(IRepository repository, ILog log, string targetBranch, Config configuration, bool onlyEvaluateTrackedBranches = false, string commitId = null)
18-
: this(repository, log, GetTargetBranch(repository, targetBranch), configuration, onlyEvaluateTrackedBranches, commitId)
17+
public GitVersionContext(IRepository repository, ILog log, string targetBranch, Config configuration, bool onlyTrackedBranches = false, string commitId = null)
18+
: this(repository, log, GetTargetBranch(repository, targetBranch), configuration, onlyTrackedBranches, commitId)
1919
{
2020
}
2121

22-
public GitVersionContext(IRepository repository, ILog log, Branch currentBranch, Config configuration, bool onlyEvaluateTrackedBranches = false, string commitId = null)
22+
public GitVersionContext(IRepository repository, ILog log, Branch currentBranch, Config configuration, bool onlyTrackedBranches = false, string commitId = null)
2323
{
2424
this.log = log;
2525
Repository = repository;
2626
RepositoryMetadataProvider = new GitRepoMetadataProvider(repository, log, configuration);
2727
FullConfiguration = configuration;
28-
OnlyEvaluateTrackedBranches = onlyEvaluateTrackedBranches;
28+
OnlyTrackedBranches = onlyTrackedBranches;
2929

3030
if (currentBranch == null)
3131
throw new InvalidOperationException("Need a branch to operate on");
@@ -53,7 +53,7 @@ public GitVersionContext(IRepository repository, ILog log, Branch currentBranch,
5353

5454
if (currentBranch.IsDetachedHead())
5555
{
56-
CurrentBranch = RepositoryMetadataProvider.GetBranchesContainingCommit(CurrentCommit, repository.Branches.ToList(), OnlyEvaluateTrackedBranches).OnlyOrDefault() ?? currentBranch;
56+
CurrentBranch = RepositoryMetadataProvider.GetBranchesContainingCommit(CurrentCommit, repository.Branches.ToList(), OnlyTrackedBranches).OnlyOrDefault() ?? currentBranch;
5757
}
5858
else
5959
{
@@ -78,7 +78,7 @@ public GitVersionContext(IRepository repository, ILog log, Branch currentBranch,
7878
/// </summary>
7979
public Config FullConfiguration { get; }
8080
public SemanticVersion CurrentCommitTaggedVersion { get; }
81-
public bool OnlyEvaluateTrackedBranches { get; }
81+
public bool OnlyTrackedBranches { get; }
8282
public EffectiveConfiguration Configuration { get; private set; }
8383
public IRepository Repository { get; }
8484
public Branch CurrentBranch { get; }

0 commit comments

Comments
 (0)