Skip to content

Commit 62a1587

Browse files
committed
Introduce GitVersionFinder.ShouldGitHubFlowVersioningSchemeApply()
1 parent 9810ec1 commit 62a1587

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

GitFlowVersion/GitVersionFinder.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ public VersionAndBranch FindVersion(GitVersionContext context)
1010
{
1111
EnsureMainTopologyConstraints(context);
1212

13-
var hasDevelopBranch = context.Repository.FindBranch("develop") != null;
14-
15-
if (hasDevelopBranch)
13+
if (ShouldGitHubFlowVersioningSchemeApply(context.Repository))
1614
{
17-
return new GitFlowVersionFinder().FindVersion(context);
15+
return new GitHubFlowVersionFinder().FindVersion(context);
1816
}
19-
return new GitHubFlowVersionFinder().FindVersion(context);
17+
18+
return new GitFlowVersionFinder().FindVersion(context);
19+
}
20+
21+
public static bool ShouldGitHubFlowVersioningSchemeApply(IRepository repo)
22+
{
23+
return repo.FindBranch("develop") == null;
2024
}
2125

2226
void EnsureMainTopologyConstraints(GitVersionContext context)

0 commit comments

Comments
 (0)