Skip to content

Commit 14fb6c6

Browse files
committed
Remove requirement on master branch existing
- As per discussion here: https://gitter.im/GitTools/GitVersion?at=565781d10d143098620f6250 - Removed redundant code
1 parent 3d421be commit 14fb6c6

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/GitVersionCore/GitVersionFinder.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public SemanticVersion FindVersion(GitVersionContext context)
2323

2424
void EnsureMainTopologyConstraints(GitVersionContext context)
2525
{
26-
EnsureLocalBranchExists(context.Repository, "master");
2726
EnsureHeadIsNotDetached(context);
2827
}
2928

@@ -40,16 +39,5 @@ void EnsureHeadIsNotDetached(GitVersionContext context)
4039
context.CurrentCommit.Id.ToString(7));
4140
throw new WarningException(message);
4241
}
43-
44-
void EnsureLocalBranchExists(IRepository repository, string branchName)
45-
{
46-
if (repository.FindBranch(branchName) != null)
47-
{
48-
return;
49-
}
50-
51-
var existingBranches = string.Format("'{0}'", string.Join("', '", repository.Branches.Select(x => x.CanonicalName)));
52-
throw new WarningException(string.Format("This repository doesn't contain a branch named '{0}'. Please create one. Existing branches: {1}", branchName, existingBranches));
53-
}
5442
}
5543
}

0 commit comments

Comments
 (0)